Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Upload using MultipartRequest...  RSS feed

 
Mandy Smith
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!