Forum Moderators: coopster

Message Too Old, No Replies

Upload a file & store its contents in a variable

Upload a file & store its contents in a variable

         

vivek avasthi

9:21 pm on Jun 10, 2006 (gmt 0)

10+ Year Member



Upload a file & store its contents in a variable

Hi ,

i just want to upload a file through browse

<INPUT type=file name=import_file2>

and i don't want to store it .. i just want to store this file contents in a Variable.

coopster

10:06 pm on Jun 10, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Then instead of moving the uploaded file [php.net] you would simply read it into your variable from your temporary directory to which the file was uploaded. I would think that perhaps file_get_contents() [php.net] should work. Don't forget you may want to delete the file from your temporary directory after you have read it into your variable.