开发者

MootoolsFancy Upload

开发者 https://www.devze.com 2023-02-28 19:08 出处:网络
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 i

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_b开发者_开发百科each_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


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'];
0

精彩评论

暂无评论...
验证码 换一张
取 消