Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I need help

im working on project(website) .the user can upload and download files .
for upload am making the files uploaded in server(glassfish) and some info about file stored in database(table projects[id autoincrement,file name]) .My question is I want when the file uploaded .a folder will be created on server that takes the autoincrement id as a name . (for each file uploaded must has a folder created for it on server)




Thanks in advance
Posted
Comments
Jim Jos 22-May-12 3:31am    
If you can create the folder from a standalone java applcation, you can create the folder using a servlet, JSP or any other server-side code. All the restrictions from the filesystem security is in effect for the user and group IDs that the server runs under applies to the servelet code also...

1 solution

Hi,

try following to create a directory
Java
new File(request.getRealPath("users") + "/me@this.com").mkdir();

Best Luck
happy Coding:)
 
Share this answer
 
Comments
tyma 22-May-12 4:42am    
OK. but this code just create a folder on server.... true? .how i can let the folder take the autoincrement id of file as a name.
tyma 22-May-12 4:47am    
Can you explain what is written (new File(request.getRealPath("users") + "/me@this.com").mkdir(); ) [users] what is it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900