Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Upload::save() says it worked...but the file isn't there
  • I'm using the Upload class to handle a file upload. When I call \Upload::save() followed by $file = \Upload::get_files(), the $file array holds data that suggests that the file was uploaded successfully. However, when I check the "saved_to" location for the "saved_as" file, it doesn't exist. The $file array doesn't have any errors listed:

    This is a var_dump($file):

    array(2) {
    [0]=>
    array(12) {
    ["field"]=>
    string(5) "photo"
    ["name"]=>
    string(41) "Screen Shot 2013-03-21 at 11.51.37 PM.png"
    ["type"]=>
    string(9) "image/png"
    ["file"]=>
    string(14) "/tmp/phpRaGlbs"
    ["error"]=>
    bool(false)
    ["size"]=>
    int(179226)
    ["extension"]=>
    string(3) "png"
    ["basename"]=>
    string(37) "Screen Shot 2013-03-21 at 11.51.37 PM"
    ["mimetype"]=>
    string(9) "image/png"
    ["saved_to"]=>
    string(21) "/mnt/static/clients/20/profile-photos/"
    ["saved_as"]=>
    string(36) "3ecbb9b4830cae95ddf601d1d45c3b29.png"
    ["errors"]=>
    array(0) {
    }
    }

    The /mnt/static location is an Amazon S3 bucket that is mounted using RioFS. I can write to the bucket from the command prompt. I can also use PHP to create files and directories using touch() and mkdir(). The problem seems to be upload-specific. I'm going to try using PHP's native upload functions and see if I can't get it to work that way.
  • HarroHarro
    Accepted Answer
    I don't see where this can go wrong, the Upload class does use PHP's native upload functions, it's just a wrapper around it that does a lot of validation and prep work.

    In the end, it just uses move_uploaded_file(), like you would do manually.

    Perhaps you can debug that bit of the upload class, and see what goes wrong? If it's a bug, we need to get that fixed before the 1.6 release.
  • That's what I figured. Working on it; I'll let you know what I determine.
  • Update: It's an issue with FUSE

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion