I need to save some image files from user directory to the project folder on server, but I cant find working solution. What is the simplest way to select file in users pc and copy it to the server? And what url may I use to acces this file?
Asked
Active
Viewed 148 times
0
-
1Why don't you just use an FTP server? What do you need the applet for? – Hali Apr 23 '12 at 14:38
-
I am creating a diagram editor, where diagram is composed from image files, so I need upload images from user to the server, then store some projects data in xml file. – user1351423 Apr 24 '12 at 15:53
1 Answers
1
Run an FTP(S) server, and use a Java FTP client to connect and upload the files. You can make the FTP home directory a subfolder of wwwroot on your server, so you can access the uploaded files as "example.com/diagrams/mydiagram".
Beware though, the client must have the FTP password to connect, therefore your users can upload anything they want (including malicious scripts). If you don't trust your users, you'll need per user auth and verification of the uploaded files, which will require server side code.

Hali
- 745
- 1
- 5
- 15