1

I'm working on Webdav client Sardine. I'm unable to create a new file (ex: file.txt) on server using Sardine webclient for Webdav. I created the directory using

sardine.createDirectory(dirPathToCreate);

Is there any way to create a new file using Sardine?

George Netu
  • 2,758
  • 4
  • 28
  • 49
sha
  • 1,410
  • 2
  • 18
  • 37

1 Answers1

1

You can use the [Sardine.put] https://github.com/lookfirst/sardine/wiki/UsageGuide

Nejmeddine
  • 23
  • 4
jawi
  • 360
  • 1
  • 7
  • Hi Jawi.Frstly,Thanks for reply. Sardine.put("directoryPath/nameOfFile.jpg", fis)) asks for the fully qualified path.The thing is i am having a directory 'directoryPath' but not having the file (nameOfFile.jpg) in it.I have to create a new file with name nameofFile.jpg in directory 'directoryPath'.Is it possible? – sha Nov 08 '11 at 08:24
  • It works according to the HTTP PUT method, which will create a new resource if needed. So doing a Sarding.put("/path/to/myFile.jpg") will create the "/path/to/myFile.jpg" file if needed, or replace it if it already exists... – jawi Nov 08 '11 at 13:50
  • Thanks a lot jawi.But i came 2 know for android, Sadine is not the best Webdav client due to dependencies. – sha Nov 09 '11 at 08:22