aspose file tools*
The moose likes JSP and the fly likes Cannot get filenames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Cannot get filenames" Watch "Cannot get filenames" New topic
Author

Cannot get filenames

Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Good Day!

I just want to get the filenames from the form in my jsp:

index.jsp


To get the filenames I used :



But the result is always NULL.

I changed it to:


Now the output is blank.

What is it that I am missing?

Thanks.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Getting files is not that simple. Please refer to this FAQ


[My Blog]
All roads lead to JavaRanch
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Okay. Just wondering why it didn't work for me. One of my team mates happen to use the same code and it worked for him.

Thanks.

God bless.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Maybe your teammate was not using enctype="multipart/form-data" for his form, only sending filenames, not file content.
If you use "multipart/form-data", your request will be looking something like this :

Unless you parse the content, you won't get the filenames easily.
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Thanks a lot.

I got this working!

God bless.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot get filenames