<?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 Re: file sharing app in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46921#M1478</link>
    <description>&lt;P&gt;I am trying to do it automatically and without having the phone open a browser. I don't really want the file saved to disk, I just want the file contents. Ideally the user gets an email that says, "Bob shared a file with you from this great app!" The person clicks the link and the app opens, downloads the file from Dropbox and opens the file.&lt;/P&gt;

&lt;P&gt;I use the API to get a short link, I pass the short link into my app, attach the "?dl=1" to the link and use a post request to try to retrieve the data. What is returned is a bunch of what appears to be html. I admit that I'm no expert in using POST. Any thoughts on what I might be doing wrong?&lt;/P&gt;</description>
    <pubDate>Sat, 04 Apr 2015 06:32:05 GMT</pubDate>
    <dc:creator>Mark S.115</dc:creator>
    <dc:date>2015-04-04T06:32:05Z</dc:date>
    <item>
      <title>file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46917#M1474</link>
      <description>&lt;P&gt;I'm using Dropbox to back up files for my app. I want to enable users to share files that are stored on Dropbox. Currently the app gets a share link and reformats it in a way that when clicked, the app will open and then a post request will attempt to get the file from the share link. So far, instead of getting the file I get a web page.&lt;/P&gt;

&lt;P&gt;From inside the app I'm using a post request with the share link followed by ?dl=1. Any advice? Is there a better way to do this? Like I said, it's not working.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:43:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46917#M1474</guid>
      <dc:creator>Mark S.115</dc:creator>
      <dc:date>2019-05-29T09:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46918#M1475</link>
      <description>&lt;P&gt;Of the top of my head, the front end of the link changes as well. Create one and go to the page, and check what the link on the download button is, that has the ?dl=1 at the end, but i think they adjust the front as well, (i dont have one here to look at sorry)&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 03:15:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46918#M1475</guid>
      <dc:creator>Dave C.5</dc:creator>
      <dc:date>2015-04-04T03:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46919#M1476</link>
      <description>&lt;P&gt;Thanks for the answer, I looked into it and it appears that it goes to something like... &lt;A href="https://dl.dropboxusercontent.com/content_link/" rel="nofollow noreferrer"&gt;https://dl.dropboxusercontent.com/content_link/&lt;/A&gt; ... and then a string that doesn't look anything like the short string in the original link.&lt;/P&gt;

&lt;P&gt;I'm guessing this means it isn't going to work.&lt;/P&gt;

&lt;P&gt;I'm exploring the possibility of using &lt;CODE&gt;copy_ref&lt;/CODE&gt;, and send the &lt;CODE&gt;copy_ref&lt;/CODE&gt; as a parameter to the app when it opens... then have it automate adding the file to the owners dropbox and then downloading the file. It's a little clunky if the person receiving the file hasn't already authorized Dropbox in the app, but it should work and that may be what I have to do.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 03:45:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46919#M1476</guid>
      <dc:creator>Mark S.115</dc:creator>
      <dc:date>2015-04-04T03:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46920#M1477</link>
      <description>&lt;P&gt;Using &lt;CODE&gt;?dl=1&lt;/CODE&gt; should indeed cause the file to get downloaded (after a redirect). What's the issue you're running into?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 05:48:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46920#M1477</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-04-04T05:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46921#M1478</link>
      <description>&lt;P&gt;I am trying to do it automatically and without having the phone open a browser. I don't really want the file saved to disk, I just want the file contents. Ideally the user gets an email that says, "Bob shared a file with you from this great app!" The person clicks the link and the app opens, downloads the file from Dropbox and opens the file.&lt;/P&gt;

&lt;P&gt;I use the API to get a short link, I pass the short link into my app, attach the "?dl=1" to the link and use a post request to try to retrieve the data. What is returned is a bunch of what appears to be html. I admit that I'm no expert in using POST. Any thoughts on what I might be doing wrong?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 06:32:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46921#M1478</guid>
      <dc:creator>Mark S.115</dc:creator>
      <dc:date>2015-04-04T06:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46922#M1479</link>
      <description>&lt;P&gt;You shouldn't be using a POST... just a GET.&lt;/P&gt;

&lt;P&gt;You might want to use &lt;CODE&gt;?raw=1&lt;/CODE&gt; instead of &lt;CODE&gt;?dl=1&lt;/CODE&gt;, but they're similar. The response should be a redirect. Depending on what method/library you're using to fetch the URL, it may follow the redirect automatically.&lt;/P&gt;

&lt;P&gt;If it doesn't, you can do it yourself. You'll get a 302 response with a &lt;CODE&gt;Location&lt;/CODE&gt; header. The &lt;CODE&gt;Location&lt;/CODE&gt; header will contain a URL, and you can fetch the content at that URL.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 10:54:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46922#M1479</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-04-04T10:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46923#M1480</link>
      <description>&lt;P&gt;For reference, the parameters for shared links are documented here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.dropbox.com/help/201" rel="nofollow noreferrer"&gt;https://www.dropbox.com/help/201&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Apr 2015 23:44:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46923#M1480</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2015-04-04T23:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46924#M1481</link>
      <description>&lt;P&gt;When I do the request, instead of getting the file data I get this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;html&amp;gt;
 &amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Found&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;
 &amp;lt;body&amp;gt;
   &amp;lt;h1&amp;gt;Found&amp;lt;/h1&amp;gt;
   &amp;lt;p&amp;gt;The resource was found at &amp;lt;a href="https://dl.dropboxusercontent.com/content_link/blahblahblah?dl=1"&amp;gt;https://dl.dropboxusercontent.com/content_link/blahblahblah?dl=1&amp;lt;/a&amp;gt;;
you should be redirected automatically.

&amp;lt;!--  --&amp;gt;&amp;lt;/p&amp;gt;
   &amp;lt;hr noshade&amp;gt;
   &amp;lt;div align="right"&amp;gt;WSGI Server&amp;lt;/div&amp;gt;
 &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm going to try parsing this response and pulling out the link and running the GET again. It just seems that this would be a common enough task that it would be more straight forward than that.&lt;/P&gt;

&lt;P&gt;For the record, I read the documentation which is why I know to use &lt;CODE&gt;?dl=1&lt;/CODE&gt;. I also tried &lt;CODE&gt;?raw=1&lt;/CODE&gt;, and I tried adding them both. None of these give me the file.&lt;/P&gt;

&lt;P&gt;If this sheds some light on the problem, I am using network.request from Corona SDK. Supposedly this handles redirects. Also, I have tried using &lt;CODE&gt;short_url = true&lt;/CODE&gt; and &lt;CODE&gt;short_url = false&lt;/CODE&gt;. I found out that it needs to be "false" because the &lt;CODE&gt;short_url&lt;/CODE&gt; provided by your system includes &lt;CODE&gt;?dl=0&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:04:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46924#M1481</guid>
      <dc:creator>Mark S.115</dc:creator>
      <dc:date>2015-04-06T23:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46925#M1482</link>
      <description>&lt;P&gt;That's the redirect I mentioned. I would strongly recommend looking at the &lt;CODE&gt;Location&lt;/CODE&gt; header rather than trying to parse the returned HTML. The header should contain the same URL but not require any fragile parsing.&lt;/P&gt;

&lt;P&gt;I don't have any direct experience with Corona SDK, but I'd agree that the &lt;A href="http://docs.coronalabs.com/api/library/network/request.html" rel="nofollow noreferrer"&gt;&lt;CODE&gt;network.request&lt;/CODE&gt; documentation&lt;/A&gt; makes it look like the default behavior is to follow redirects. I don't have any insight as to why that isn't working as expected.&lt;/P&gt;

&lt;P&gt;Since it looks like you're getting the original response (before the redirect), I'd suggest using &lt;CODE&gt;event.responseHeaders.Location&lt;/CODE&gt; to get the URL from the 302 response. Or ping the Corona folks to figure out why the automatic redirect following isn't working.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:20:30 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46925#M1482</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-04-06T23:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: file sharing app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46926#M1483</link>
      <description>&lt;P&gt;Thank you, that got it done. For whatever reason the error was not being handled. I turned off their error handling (in case they ever changed it) and made my own error handling function as you directed and now it works.&lt;/P&gt;

&lt;P&gt;I have a character sheet app for role playing games and I want to enable people to make a character sheet for someone else and email it to them. Thanks to your advice it now works by sharing a file saved on Dropbox. If you are interested in the app you can check it out at &lt;A href="https://www.legendofus.net" rel="nofollow noreferrer"&gt;https://www.legendofus.net&lt;/A&gt;. The feature should be live in a couple of weeks. Hopefully people will like it.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 02:54:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/file-sharing-app/m-p/46926#M1483</guid>
      <dc:creator>Mark S.115</dc:creator>
      <dc:date>2015-04-07T02:54:44Z</dc:date>
    </item>
  </channel>
</rss>

