LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   form to submit csv file to handle (https://www.linuxquestions.org/questions/programming-9/form-to-submit-csv-file-to-handle-822026/)

eco 07-25-2010 06:06 AM

form to submit csv file to handle
 
Hi all,

I'm new to php and need some pointers to worth while documentation 'cause I'm getting nowhere ;)

I want to make a simple html form that allows me to submit a csv file so that I can work on it.

The problem seems to be that if the file is not in the root of the (web) application it won't work.

The form doesn't seem to send the path with it so I am unable to (1) know where the file is, I just get the name of the file and (2) I couldn't access the file anyway as it's outside of the apache environment.

Is there a way to up the file to memory? How would you do this?

Any help or working example or just an explanation why it's all wrong would be appreciated!

Thanks!

zirias 07-25-2010 03:26 PM

Huh? You can just use a "standard" file input, causing an upload of the file. It will be put in some temporary path (configured in php.ini), but in fact, you don't have to care, just use the $_FILES¹ global to locate it and move it wherever you like.

--
¹ http://php.net/manual/en/reserved.variables.files.php

acvoight 07-25-2010 04:39 PM

This will probably help you:
http://www.w3schools.com/php/php_file_upload.asp

eco 07-26-2010 12:09 AM

Thank you both for your answers. I thought there was a way. :)


All times are GMT -5. The time now is 03:07 AM.