Small Bai Tiu help ~uploadify picture upload problem

Source: Internet
Author: User
Encountered a PHP problem I upload images with uploadify plugin failed to know what is the reason for the plug-in did not tell me the error I backstage Echo found Move_uploaded_file () returns a false function of two parameters are then found in the temporary folder/private/ var/tmp/did not generate the file to be uploaded p.s. I use the Mac when the server is the system permissions problem?


Reply to discussion (solution)

The uploaded file is reserved for this request only, which means that when your code is finished, the temporary file will be destroyed and you will not be able to see it.
This situation is mostly related to the permissions of the target directory and requires write permission to the target directory owner

The uploaded file is reserved for this request only, which means that when your code is finished, the temporary file will be destroyed and you will not be able to see it.
This situation is mostly related to the permissions of the target directory and requires write permission to the target directory owner

has given everyone permission to read and write, or not to ask for help ~

$to = files to be moved to the new directory; Var_dump ($FILES, $to, Is_writable (dirname ($to)));

See what results?

PHP code?12$to = files to be moved to the new directory; Var_dump ($FILES, $to, Is_writable (dirname ($to)));
See what results?

String ("/private/var/tmp/phpctmjjv")
String ("/library/webserver/documents/handler/uploads/6573d7a11f3e8ed173239f20e3de3f7d")
BOOL (FALSE)

How to solve it?

/library/webserver/documents/handler/uploads/does not have all writable permissions, so is_writable returns false

/library/webserver/documents/handler/uploads/does not have all writable permissions, so is_writable returns false

String ("/private/var/tmp/phpurxycu")
String ("/library/webserver/documents/handler/uploads/b4f1262969d27fee9c4a867a8d109573")
BOOL (TRUE)
Now give permission and then find the Uploads folder is still empty, uh.

So this time move_uploaded_file () return or FALSE, how do you call it?
Try this:

$from = "/PRIVATE/VAR/TMP/PHPURXYCU"; Source file $_files[' name ' [' tmp_name '] $to = "/library/webserver/documents/handler/uploads/ b4f1262969d27fee9c4a867a8d109573 "; Var_dump (Is_readable ($from), file_put_contents ($to, file_get_contents ($from))) ;

If the return is true false then I don't know what the situation is.

So this time move_uploaded_file () return or FALSE, how do you call it?
Try this:

PHP code?123$from = "/PRIVATE/VAR/TMP/PHPURXYCU"; Source file $_files[' name ' [' tmp_name '] $to = "/library/webserver/documents/handler/up ...

Okay, I'm 2. Move code let me//now OK thank you ~

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.