0

So I want to upload a file from the app's internal storage to DropBox witch I can't get working

i goth the file location in the variable location from and i know if works because I'm already using this path for making a copy off the file to the sdcard

         String currentDBPath = "\\simon.vestergaard.note.calender\\databases\\NoteCalender";
         String backupDBPath = "NoteCalender";


         File locationfrom = new File(data + ""+data+"/simon.vestergaard.note.calender"+ "/databases",backupDBPath);enter code here

i need to use the dropbox to upload the file where I'm using this metode https://www.dropbox.com/static/developers/dropbox-android-sdk-1.2.2-docs/index.html but it requires the file as a input stream how can i due this?

my question is how can i get to the file thats stored in data\data\simon.vestergaard.note.calender\databases\NoteCalender and get it as a inputstream and send i with putfileOverWrite ore put file ??

1 Answers1

0

toString is not how you get the contents of a stream. This post might be helpful to you: Read/convert an InputStream to a String

Community
  • 1
  • 1
kabuko
  • 35,009
  • 7
  • 75
  • 92
  • okay ty i changed somem off the code and look at it a little more and i found out that im giving the bytearrayinputstream im giving it a vaibal not a file with is what i wan't to –  Jan 06 '12 at 20:41
  • Ah yeah, didn't even notice that. You're using getBytes() on a string which is not going to get you the contents of the file. – kabuko Jan 06 '12 at 22:22
  • due you know how i cut get the contents off the file / all bytes the file contain?? –  Jan 07 '12 at 11:42