<?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 What link do I use to read a JPG with code? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-link-do-I-use-to-read-a-JPG-with-code/m-p/754852#M33046</link>
    <description>&lt;P&gt;I put a JPG on dropbox (in a subfolder) and I am trying to download that JPG using a javascript fetch command.&amp;nbsp; My code works fine with JPGs hosted on various other servers including Google Drive.&lt;/P&gt;
&lt;P&gt;My javascript code is using this link:&amp;nbsp; &lt;A href="https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1" target="_blank" rel="noopener"&gt;https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The purpose for downloading the JPG is so my code can use the cache API to save the JPG on the user's device.&amp;nbsp; This is all part of the GeoJPG web app I developed for offline maps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I enter the above link into a browser tab then I am invited to&amp;nbsp; download the JPG.&amp;nbsp; However, when I try to download the JPG content with my javascript then the following error messages show up in the browser's console.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Failed to load ‘&lt;A href="https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1’" target="_blank" rel="noopener"&gt;https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1’&lt;/A&gt;. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘TypeError: NetworkError when attempting to fetch resource.’.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at &lt;A href="https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1" target="_blank" rel="noopener"&gt;https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1&lt;/A&gt;. (Reason: CORS request did not succeed). Status code: (null).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What am I missing?&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Mar 2024 18:19:10 GMT</pubDate>
    <dc:creator>mappingsupport</dc:creator>
    <dc:date>2024-03-04T18:19:10Z</dc:date>
    <item>
      <title>What link do I use to read a JPG with code?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-link-do-I-use-to-read-a-JPG-with-code/m-p/754852#M33046</link>
      <description>&lt;P&gt;I put a JPG on dropbox (in a subfolder) and I am trying to download that JPG using a javascript fetch command.&amp;nbsp; My code works fine with JPGs hosted on various other servers including Google Drive.&lt;/P&gt;
&lt;P&gt;My javascript code is using this link:&amp;nbsp; &lt;A href="https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1" target="_blank" rel="noopener"&gt;https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The purpose for downloading the JPG is so my code can use the cache API to save the JPG on the user's device.&amp;nbsp; This is all part of the GeoJPG web app I developed for offline maps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I enter the above link into a browser tab then I am invited to&amp;nbsp; download the JPG.&amp;nbsp; However, when I try to download the JPG content with my javascript then the following error messages show up in the browser's console.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Failed to load ‘&lt;A href="https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1’" target="_blank" rel="noopener"&gt;https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1’&lt;/A&gt;. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘TypeError: NetworkError when attempting to fetch resource.’.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at &lt;A href="https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1" target="_blank" rel="noopener"&gt;https://www.dropbox.com/scl/fi/ea9go6nont63t556sy6o4/WA_Chiwaukum_big_open_topo.jpg?rlkey=m7girlv2c79sq98u0retjcs6e&amp;amp;dl=1&lt;/A&gt;. (Reason: CORS request did not succeed). Status code: (null).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What am I missing?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 18:19:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-link-do-I-use-to-read-a-JPG-with-code/m-p/754852#M33046</guid>
      <dc:creator>mappingsupport</dc:creator>
      <dc:date>2024-03-04T18:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: What link do I use to read a JPG with code?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-link-do-I-use-to-read-a-JPG-with-code/m-p/754887#M33047</link>
      <description>&lt;P&gt;The &lt;A href="http://www.dropbox.com" target="_blank"&gt;www.dropbox.com&lt;/A&gt; website does not allow CORS requests, so attempting to access that from browser JavaScript will fail like that. There's also &lt;A href="https://www.dropboxforum.com/t5/View-download-and-export/Shared-Link-quot-scl-quot-to-quot-s-quot/m-p/695266/highlight/true#M49151" target="_blank"&gt;some information and options on these links here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, if you want to programmatically download content from a shared link in JavaScript, you can instead use &lt;A href="https://github.com/dropbox/dropbox-sdk-js" target="_blank"&gt;the Dropbox JavaScript SDK&lt;/A&gt;. In particular, the &lt;A href="https://dropbox.github.io/dropbox-sdk-js/Dropbox.html#sharingGetSharedLinkFile__anchor" target="_blank"&gt;sharingGetSharedLinkFile&lt;/A&gt; method allows an app to specify a shared link URL and get the linked file data back.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 19:10:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/What-link-do-I-use-to-read-a-JPG-with-code/m-p/754887#M33047</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2024-03-04T19:10:33Z</dc:date>
    </item>
  </channel>
</rss>

