<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Check File exist before uploading DropBoxApi in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Check-File-exist-before-uploading-DropBoxApi/m-p/44275#M1355</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;Entry existingentry= dropbox.metadata(path + "sample.txt",1,null,false,null);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Actual Method:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;protected Boolean doInBackground(Void... params) {
    final File tempDir = context.getCacheDir();
    File tempFile;
    FileWriter fr;
    try {
        tempFile = File.createTempFile("file", ".txt", tempDir);
        fr = new FileWriter(tempFile);
        fr.write("Test file uploaded using Dropbox API for Android");
        fr.close();

        FileInputStream fileInputStream = new FileInputStream(tempFile);

      Entry existingentry= dropbox.metadata(path + "sample.txt",1,null,false,null);

            dropbox.putFile(path + "sample.txt", fileInputStream,
                    tempFile.length(), null, null);
            tempFile.delete();

        return true;
    } catch (IOException e) {
        e.printStackTrace();
    } catch (DropboxException e) {
        e.printStackTrace();
    }
    return false;
}


@Override
protected void onPostExecute(Boolean result) {
    if (result) {
        Toast.makeText(context, "File Uploaded Successfully!",
                Toast.LENGTH_LONG).show();
    } else {
        Toast.makeText(context, "Failed to upload file", Toast.LENGTH_LONG)
                .show();
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 May 2019 09:41:25 GMT</pubDate>
    <dc:creator>lalit j.</dc:creator>
    <dc:date>2019-05-29T09:41:25Z</dc:date>
    <item>
      <title>Check File exist before uploading DropBoxApi</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Check-File-exist-before-uploading-DropBoxApi/m-p/44275#M1355</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;Entry existingentry= dropbox.metadata(path + "sample.txt",1,null,false,null);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Actual Method:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;protected Boolean doInBackground(Void... params) {
    final File tempDir = context.getCacheDir();
    File tempFile;
    FileWriter fr;
    try {
        tempFile = File.createTempFile("file", ".txt", tempDir);
        fr = new FileWriter(tempFile);
        fr.write("Test file uploaded using Dropbox API for Android");
        fr.close();

        FileInputStream fileInputStream = new FileInputStream(tempFile);

      Entry existingentry= dropbox.metadata(path + "sample.txt",1,null,false,null);

            dropbox.putFile(path + "sample.txt", fileInputStream,
                    tempFile.length(), null, null);
            tempFile.delete();

        return true;
    } catch (IOException e) {
        e.printStackTrace();
    } catch (DropboxException e) {
        e.printStackTrace();
    }
    return false;
}


@Override
protected void onPostExecute(Boolean result) {
    if (result) {
        Toast.makeText(context, "File Uploaded Successfully!",
                Toast.LENGTH_LONG).show();
    } else {
        Toast.makeText(context, "Failed to upload file", Toast.LENGTH_LONG)
                .show();
    }
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:41:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Check-File-exist-before-uploading-DropBoxApi/m-p/44275#M1355</guid>
      <dc:creator>lalit j.</dc:creator>
      <dc:date>2019-05-29T09:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Check File exist before uploading DropBoxApi</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Check-File-exist-before-uploading-DropBoxApi/m-p/44276#M1356</link>
      <description>&lt;P&gt;[Cross-linking for reference: &lt;A href="https://stackoverflow.com/questions/31314298/dropboxapi-check-file-exist-or-not" rel="nofollow noreferrer"&gt;https://stackoverflow.com/questions/31314298/dropboxapi-check-file-exist-or-not&lt;/A&gt; and &lt;A href="https://stackoverflow.com/questions/31324098/check-file-exist-before-uploading-dropboxapi" rel="nofollow noreferrer"&gt;https://stackoverflow.com/questions/31324098/check-file-exist-before-uploading-dropboxapi&lt;/A&gt; ]&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 01:48:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Check-File-exist-before-uploading-DropBoxApi/m-p/44276#M1356</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-07-10T01:48:14Z</dc:date>
    </item>
  </channel>
</rss>

