2

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 Answers3

1

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.

Upload image to server

encastellano
  • 435
  • 3
  • 5
  • where do I specify the folder name ? in the URL which I am sending up? – Nadir Ahmed Feb 15 '16 at 13:54
  • In your webservice, you can pass parameters. You can pass fileName, folderName and even more parameters. This post explains the whole case: http://stackoverflow.com/questions/2935946/sending-images-using-http-post – encastellano Feb 15 '16 at 14:01
1
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.

Panda
  • 27
  • 6
  • I think he want to create folder in the server side for storage, not in app – encastellano Feb 15 '16 at 13:56
  • 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 – Panda Feb 15 '16 at 14:43
0

I think that logic must handle the server side

Usman R
  • 76
  • 6