使用 php 更具体地说是 HTTP_RAW_POST_DATA 从 flash 上传图像?
我目前正在使用它,因此它会显示一个对话框以将图像保存在您的计算机上:
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// get bytearray
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
// add headers for download dialog-box
header('Content-Type: image/jpeg');
header("Content-Disposition: attachment; filename=".$_GET['name']);
echo $jpg;
}
只是想知道是否有任何方法可以将文件直接放入目录/文件而不需要对话框?
像上传者一样?
I currently have it working so it displays a dialogue box to save the image on your computer:
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
{
// get bytearray
$jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
// add headers for download dialog-box
header('Content-Type: image/jpeg');
header("Content-Disposition: attachment; filename=".$_GET['name']);
echo $jpg;
}
just wondered if there is any way to put the file straight into a directory/file without the need of a dialogue box?
like an uploader?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,没有。
No, there is not.
只需读取页面内容并使用 fopen 、 fwrite 等保存在文件中,
或者以下是我的代码,您可以删除对您无用的不必要的内容
Just Read the content of the page and save in a file using fopen , fwrite e.t.c.
OR following is my code you can remove unneccessary things that are not useful for you