YossiBa
asked on
How do I draw filename only using input type="file" ??
Hi,
I need to retrieve after clicking the browse button, the name of the file I'm uploading.
I need the name and type of the file alone, not the full path.
I'm using
<input type="file" class="text" size="40" id="filePath" name="filePath" value = "">
filePath property- gets me the file name and path.
Please advise
Thanks
Jo
I need to retrieve after clicking the browse button, the name of the file I'm uploading.
I need the name and type of the file alone, not the full path.
I'm using
<input type="file" class="text" size="40" id="filePath" name="filePath" value = "">
filePath property- gets me the file name and path.
Please advise
Thanks
Jo
ASKER
Hi,
I'm using input type="file" tag in struts as my jsp.
<input type="file" name="file_Path" style="display:none;>
My perpose is actually not to upload the file but to mark a file using a browser and retrieve its name in a text box.
It works great but I get the full path along with name of the file.
Do you know how to get my need using this tag?
Thanks
Jo
I'm using input type="file" tag in struts as my jsp.
<input type="file" name="file_Path" style="display:none;>
My perpose is actually not to upload the file but to mark a file using a browser and retrieve its name in a text box.
It works great but I get the full path along with name of the file.
Do you know how to get my need using this tag?
Thanks
Jo
> My perpose is actually not to upload the file
using <input type="file" causes the browser to upload the file
using <input type="file" causes the browser to upload the file
sorry
eliminating ENCTYPE="multipart/form-da ta" from form properties, will prevent the upload
eliminating ENCTYPE="multipart/form-da
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi,
What do you mean in javascript? Do you mean in a js function that will use string manipulation on the filePath that holds the full path?
What do you mean in javascript? Do you mean in a js function that will use string manipulation on the filePath that holds the full path?
> Do you mean in a js function that will use string manipulation on the filePath that holds the full path?
yes
is it bad ?
yes
is it bad ?
ASKER
No, I thought of that, I just wanted to know if there is a cleaner way of doing that ,using the tag.
If not, I'll start working on this fucntion
If not, I'll start working on this fucntion
How do u upload the files? Using some API like commons fileupload. Most of the these 3rd party APIs have the facility to get the content type and filename retrieval.
for commons upload see here
http://jakarta.apache.org/commons/fileupload/