|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Getting the name of an uploaded file
Hi.
I need some help here, please.. On the HTML form the user can upload a file and I want to read it's the file name and it's content on the server. The cgi.FieldStorage() returns something like: FieldStorage(None,None, [FieldStorage(arg1, arg2, arg3) ] ) arg1 is the html element name (the file input element) arg2 is the name of the uploaded file arg 3 is the uploaded file's content. I can have access to arg1 and arg3 ( using key[].value) but I can't have access to the file name (arg2). Isn't there a simple built in function in the cgi module?! ( i didn't find any) Thank you very much Roy |
|
#2
|
||||
|
||||
|
Havn't used CGI in a while since my own Net module handles everything the way i want it to - and very well - but i believe you use '.filename' or '.file' instead of the standard '.value' name. This should give you the full path of the file being uploaded, you then just have to get the filename from the path.
Mark. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Getting the name of an uploaded file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|