This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Upload using MultipartRequest... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Upload using MultipartRequest..." Watch "Upload using MultipartRequest..." New topic
Author

Upload using MultipartRequest...

Mandy Smith
Ranch Hand

Joined: Jun 26, 2001
Posts: 62
I am able to upload to the root directory, but when i specify subdirectory, i get an error saying invalid directory.
This is what i am doing
MultipartRequest multi = new MultipartRequest(req, ".\\myserver\\public_html", 1024*1024);
The following works fine.
MultipartRequest multi =
new MultipartRequest(req, ".", 1024*1024);
Also is there way that i can get the filename first even before i do the actual upload as i want to check for the type of file, want to limit for just 3 type of files(.txt, .doc, .html). And also is there a way that i can do the virus check before its actually uploaded.
Could anyone please let me know.
Thanks,
Appreciate your help and anticipating for your reply!
Mandy Smith
Ranch Hand

Joined: Jun 26, 2001
Posts: 62
I can upload to any subdirectory in my server.
I had specified a directory which was not existing, but this works fine now.
MultipartRequest multi = new MultipartRequest(req, ".\\myserver\\public_html", 1024*1024);
I have another problem how to specify the user when the user's file exceeds max size set, it will just throw a IOException if size is greater than the specified size. How to let the user know of this? Also how to do the virus scan?
Thanks,
Appreciate your help!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Upload using MultipartRequest...
 
Similar Threads
Help in Multipart Request Urgent
Problem Using MultipartRequest
COS Query...URGENT..
Multipart Upload - where does my file go?
Multipart Upload - where does my file go?