Jump to content

[SOLVED] what should i do with file ( $_POST['image'] ) ??


yami007

Recommended Posts

Hi yami007,

 

You can't check for a file upload with the $_POST parameter, use is_uploaded_file instead and/or $_FILES instead.

 

http://us3.php.net/manual/en/function.is-uploaded-file.php

http://us.php.net/manual/en/reserved.variables.files.php

 

Hope this helps.

file uploads are stored in the $_FILES superglobal... (instead of $_POST)

 

it looked like this on the inside

The format of this array is (assuming your form has two input type=file fields named "file1", "file2", etc):

 

Array

(

    [file1] => Array

        (

            [name] => MyFile.txt (comes from the browser, so treat as tainted)

            [type] => text/plain  (not sure where it gets this from - assume the browser, so treat as tainted)

            [tmp_name] => /tmp/php/php1h4j1o (could be anywhere on your system, depending on your config settings, but the user has no control, so this isn't tainted)

            [error] => UPLOAD_ERR_OK  (= 0)

            => 123  (the size in bytes)

        )

 

    [file2] => Array

        (

            [name] => MyFile.jpg

            [type] => image/jpeg

            [tmp_name] => /tmp/php/php6hst32

            [error] => UPLOAD_ERR_OK

            => 98174

        )

)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.