How Save File in Directory and path of the file in database using Struts 2.0 and Ejb 3.0
Deepak Kumar pandey
Greenhorn
Joined: Aug 31, 2010
Posts: 11
posted
0
Hi.......
I have save the file in directory. before saving the file i have to also check directory for particular file is exist or no.
if exist save the file in existing directory and if no then create new directory and save the file.
Also i want to know how give file name when saving.
please help me.
thanks
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Welcome to JavaRanch!
It's not clear what you're asking; how to upload files? How to use basic Java file IO?
Deepak Kumar pandey
Greenhorn
Joined: Aug 31, 2010
Posts: 11
posted
0
David Newton wrote:Welcome to JavaRanch!
It's not clear what you're asking; how to upload files? How to use basic Java file IO?
I have to save file in directory and path of the file in data base using struts 2.0.
Also create directory if not exist.
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
So there are several parts to this task. I need to know which parts you're having problems with.
1) Upload a file (the only Struts-related problem)
2) Using Java to determine if a file exists
3) Writing information to a database
They're all different, they're all completely unrelated, and only item 1) is Struts-related.
For the rest, I'd ask 2) in the beginning Java forum. For 3) it depends on how you're accessing the database, but either the JDBC forum, the ORM forum, or the Spring forum (or a different one if none of those cover what you're using).
This message was edited 1 time. Last update was at by David Newton
subject: How Save File in Directory and path of the file in database using Struts 2.0 and Ejb 3.0