Mootools花式上传

发布于 2024-11-03 12:30:22 字数 705 浏览 0 评论 0原文

我刚刚在 joomla 中遇到了我认为我需要的前端多上传器脚本。

Mootools 精美上传看起来棒极了!但是当我取消注释上传上传文件夹中的图像的脚本时,我遇到了麻烦?

我所做的就是取消注释测试文件中的默认脚本,并创建一个名为 uploads 的文件夹,我将其设置为 757 并尝试了 777

但由于某种原因,上传程序现在返回一些关于 md 5 哈希内容的奇怪错误?

eastern_beach_jetty.jpgAn error occured:

Warning: md5_file(/tmp/phpUjHol4) [function.md5-file]: failed to open stream: No such file or directory in /home/user/www.mydomain.com.au/test/server/script.php on line 133

{"status":"1","name":"eastern_beach_jetty.jpg","hash":false}

我从那里获得脚本的精美上传器网站在这里 http://digitarald.de/project/fancyupload/

对此的任何帮助将不胜感激,

谢谢。 约翰

i have just come across what i think i need for my front end multi uploader script in joomla.

Mootools fancy upload looks great! but i am having trouble when i uncomment the script that uploads the images inside the uploads folder?

All i have done is uncommented the default script inside the test file and created a folder called uploads which i set to 757 and also tried 777

But for some reason the uploader now returns some strange error about md 5 hash stuff?

eastern_beach_jetty.jpgAn error occured:

Warning: md5_file(/tmp/phpUjHol4) [function.md5-file]: failed to open stream: No such file or directory in /home/user/www.mydomain.com.au/test/server/script.php on line 133

{"status":"1","name":"eastern_beach_jetty.jpg","hash":false}

The fancy uploader website from where i got the script is here http://digitarald.de/project/fancyupload/

Any help on this would be so greatly apprecited,

thank you.
John

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

可爱暴击 2024-11-10 12:30:22

巧合的是,我犯了和你一样的错误,原因是先将tmp文件移动到目标文件夹,然后引用tmp文件,该文件不再存在,因为它在目标文件夹中。我知道回复晚了,但就好像有人遇到了同样的问题。

否:

move_uploaded_file($_FILES['Filedata']['tmp_name'], '../uploads/' . $_FILES['Filedata']['name']);
$return['src'] = '/uploads/' . $_FILES['Filedata']['name'];

if ($error) {

(...)

} else {

(...)
// $return['hash'] = md5_file($_FILES['Filedata']['tmp_name']);

// ... and if available, we get image data
$info = @getimagesize($_FILES['Filedata']['tmp_name']);

if ($info) {
    $return['width'] = $info[0];
    $return['height'] = $info[1];
    $return['mime'] = $info['mime'];
}

}

是:

if ($error) {

(...)

} else {

(...)
// $return['hash'] = md5_file($_FILES['Filedata']['tmp_name']);

// ... and if available, we get image data
$info = @getimagesize($_FILES['Filedata']['tmp_name']);

if ($info) {
    $return['width'] = $info[0];
    $return['height'] = $info[1];
    $return['mime'] = $info['mime'];
}

}

move_uploaded_file($_FILES['Filedata']['tmp_name'], '../uploads/' . $_FILES['Filedata']['name']);
$return['src'] = '/uploads/' . $_FILES['Filedata']['name'];

Coincidentally, I did the same mistake as you, the reason is that the first move tmp file to the destination folder, and then referring to the tmp file, which no longer exists, because it is in the target folder. I know that the late response, but it was as if someone had the same problem.

Not:

move_uploaded_file($_FILES['Filedata']['tmp_name'], '../uploads/' . $_FILES['Filedata']['name']);
$return['src'] = '/uploads/' . $_FILES['Filedata']['name'];

if ($error) {

(...)

} else {

(...)
// $return['hash'] = md5_file($_FILES['Filedata']['tmp_name']);

// ... and if available, we get image data
$info = @getimagesize($_FILES['Filedata']['tmp_name']);

if ($info) {
    $return['width'] = $info[0];
    $return['height'] = $info[1];
    $return['mime'] = $info['mime'];
}

}

Yes:

if ($error) {

(...)

} else {

(...)
// $return['hash'] = md5_file($_FILES['Filedata']['tmp_name']);

// ... and if available, we get image data
$info = @getimagesize($_FILES['Filedata']['tmp_name']);

if ($info) {
    $return['width'] = $info[0];
    $return['height'] = $info[1];
    $return['mime'] = $info['mime'];
}

}

move_uploaded_file($_FILES['Filedata']['tmp_name'], '../uploads/' . $_FILES['Filedata']['name']);
$return['src'] = '/uploads/' . $_FILES['Filedata']['name'];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文