aspose file tools*
The moose likes Servlets and the fly likes Multiple File Upload from a directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Multiple File Upload from a directory" Watch "Multiple File Upload from a directory" New topic
Author

Multiple File Upload from a directory

Darren Alexandria
Ranch Hand

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

Is it feasible to upload all the files in a specified directory to a
database?

I have tried file upload but it has the "browse" button for the files
to upload.

This time, I want to do it automatically that when the program starts,
all the contents of a specified directory will be uploaded.

Thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Since you posted this to the "Servlets" forum, I'm assuming that by "program" you mean a web application. In that case, no, this is not possible. And that's a good thing, too - think of the security implications if it were possible to upload user files automatically to a remote site.

Using the manual file selection via the "Browse..." button is the only way, and since that doesn't allow to select directories, it is not possible to upload a complete directory.


Ping & DNS - updated with new look and Ping home screen widget
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Thanks for your reply.

Yes, I am doing a web application. The sequence of my program is this, I have an applet that uploads files from client to server's file system. Now, I will validate/parse the contents of the said folder after which I will transfer the valid files to a specified folder for it to be uploaded to the database. What I am asking is that is it possible that I will upload the valid files one by one from the directory without using the "browse" button? I don't want to upload the whole directory.

Thanks again.

God bless.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18135
    
    8

Yes, if you are using a signed applet then it can do anything with the client's files that it likes. Assuming of course that the client accepts the notification the first time they download the applet.
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Thanks for your reply Paul!

So I guess, the final answer to the question "Can I upload the files FROM a directory to the database?" is: YES?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple File Upload from a directory
 
Similar Threads
Possible to get listing of all files in directory?
doubt regarding Directory Upload using HTTPclient3.1 library
Upload all the files in the directory to server
uploading files in JSP
Directory Creation on FTP Server using Java Program