I need an android app which can upload photos to a server, but first create a "project" folder if one is not created yet. If one is already created, it will upload photos to that particular folder. The user can have several different projects going on. How can this be accomplished? I tried to look into this link which seems to work, but there is nothing about how to create that new folder on the server.
3 Answers
I think that logic must handle the server side . You must upload the picture via a webservice , and server control if that folder exists and create it if it does not exist.
This link maybe help you. The server side its a simple php script, you should replace for your own logic.
2 Comments
Nadir Ahmed
where do I specify the folder name ? in the URL which I am sending up?
encastellano
In your webservice, you can pass parameters. You can pass fileName, folderName and even more parameters. This post explains the whole case: stackoverflow.com/questions/2935946/…
new File("/path/to/folder").mkdir();
If you want to created nested folders (more than one folder on the path may be missing), then use mkdirs(). See java.io.File.
2 Comments
encastellano
I think he want to create folder in the server side for storage, not in app
Panda
yes and you write the code for creating the folder in server. doesn't matter what connection he use. the server check if there is a folder with that name he wants. if not, it create the folder then upload the image