<?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: FileNotFoundError: [Errno 2] No such file or directory in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/FileNotFoundError-Errno-2-No-such-file-or-directory/m-p/534069#M25723</link>
    <description>&lt;P&gt;If the user does not pass the full path to the file (on Unix type systems this means a path that starts with a slash), the &lt;A href="http://net-informations.com/python/file/open.htm" target="_self"&gt;python file&lt;/A&gt; path is interpreted relatively to the current working directory. The current working directory usually is the directory in which you started the program. In order to make this work, the directory containing the python executable must be in the PATH, a so-called environment variable that contains directories that are automatically used for searching executables when you enter a command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, if your Python script file and your data input file are not in the same directory, you always have to specify either a relative path between them or you have to use an absolute path for one of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 06:24:08 GMT</pubDate>
    <dc:creator>lovelmark</dc:creator>
    <dc:date>2021-07-20T06:24:08Z</dc:date>
    <item>
      <title>FileNotFoundError: [Errno 2] No such file or directory</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/FileNotFoundError-Errno-2-No-such-file-or-directory/m-p/438822#M23113</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to download a dropbox link to a .xlsx file using the following script but am getting the error "&lt;STRONG&gt;FileNotFoundError: [Errno 2] No such file or directory: '/downloadfolder/subfolder'&lt;/STRONG&gt; ", that directory does exist i can see it and have also listed files in that directory using&amp;nbsp;&lt;STRONG&gt;files_list_folder&lt;/STRONG&gt;. I've searched similar errors on here but can't get it to work, any ideas what I'm doing wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import dropbox
dbx = dropbox.Dropbox('TOKEN')
download_path = '/downloadfolder/subfolder'
path = '/folder/file.xlsx
dbx.files_download_to_file(download_path,path)&lt;/PRE&gt;
&lt;P&gt;I've also tried downloading the link via sharing_get_shared_link_file_to_file aswell but get the same error:&lt;/P&gt;
&lt;PRE&gt;download_path = '/downloadfolder/subfolder'
url_file = ('https://www.dropbox.com/scl/fi/sometext/file.xlsx?dl=0&amp;amp;rlkey=sometext')
dbx.sharing_get_shared_link_file_to_file(download_path, url_file)&lt;/PRE&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 06:02:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/FileNotFoundError-Errno-2-No-such-file-or-directory/m-p/438822#M23113</guid>
      <dc:creator>keano16</dc:creator>
      <dc:date>2020-07-21T06:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: FileNotFoundError: [Errno 2] No such file or directory</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/FileNotFoundError-Errno-2-No-such-file-or-directory/m-p/438844#M23115</link>
      <description>&lt;P&gt;The &lt;A href="https://docs.python.org/3/library/exceptions.html#FileNotFoundError" target="_self"&gt;FileNotFoundError&lt;/A&gt; "No such file or directory" error here is referring to the location on your local filesystem, not in the remote&amp;nbsp;Dropbox account. That is, the first parameter you supply to&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_download_to_file" target="_self"&gt;files_download_to_file&lt;/A&gt; (and&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.sharing_get_shared_link_file_to_file" target="_self"&gt;sharing_get_shared_link_file_to_file&lt;/A&gt; as well) is the "Path on local machine to save file". (For comparison,&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_list_folder" target="_self"&gt;files_list_folder&lt;/A&gt; lists the contents of the remote&amp;nbsp;Dropbox account.)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you should update your 'download_path' value to point to an actual location on your local filesystem, or otherwise update your local filesystem to contain that path (e.g., put a "downloadfolder" folder in your filesystem root, etc.).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that the value you provide there should be the full path, including filename and extension, so you would probably want to make it something like&amp;nbsp;'/downloadfolder/subfolder/file.xlsx', in addition to making sure the folder(s) exist locally.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 17:37:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/FileNotFoundError-Errno-2-No-such-file-or-directory/m-p/438844#M23115</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-07-20T17:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: FileNotFoundError: [Errno 2] No such file or directory</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/FileNotFoundError-Errno-2-No-such-file-or-directory/m-p/534069#M25723</link>
      <description>&lt;P&gt;If the user does not pass the full path to the file (on Unix type systems this means a path that starts with a slash), the &lt;A href="http://net-informations.com/python/file/open.htm" target="_self"&gt;python file&lt;/A&gt; path is interpreted relatively to the current working directory. The current working directory usually is the directory in which you started the program. In order to make this work, the directory containing the python executable must be in the PATH, a so-called environment variable that contains directories that are automatically used for searching executables when you enter a command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, if your Python script file and your data input file are not in the same directory, you always have to specify either a relative path between them or you have to use an absolute path for one of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 06:24:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/FileNotFoundError-Errno-2-No-such-file-or-directory/m-p/534069#M25723</guid>
      <dc:creator>lovelmark</dc:creator>
      <dc:date>2021-07-20T06:24:08Z</dc:date>
    </item>
  </channel>
</rss>

