<?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 Could not resolve host: content.dropboxapi.com when to upload file at shutdown in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Could-not-resolve-host-content-dropboxapi-com-when-to-upload/m-p/272459#M16175</link>
    <description>I want to upload file into my dropbox when my pc is shutdowning.&lt;PRE&gt;sudo vim  /etc/systemd/system/upload.service
[Unit]
Description=upload files into dropbox
Before=network.target shutdown.target  reboot.target
Requires=network-online.target

[Service]
ExecStop=/bin/true
ExecStart=/bin/bash  /home/upload.sh 
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target&lt;/PRE&gt;And the upload.sh script.&lt;PRE&gt;cd  /home
curl -X POST https://content.dropboxapi.com/2/files/upload \
            --header "Authorization: Bearer xxxx" \
            --header "Dropbox-API-Arg:  {\"path\":\"/test.txt\",\"mode\":{\".tag\":\"overwrite\"}}" \
            --header "Content-Type: application/octet-stream" \
            --data-binary @"test.txt"&lt;/PRE&gt;`bash upload.sh` can executed successfully,and file uploaded into my dropbox.&lt;PRE&gt;sudo systemctl enable upload service  &lt;/PRE&gt;To reboot my pc.&lt;PRE&gt;sudo journalctl -u upload 
Apr 13 23:58:52 localhost systemd[1]: Started upload files into dropbox.
Apr 13 23:58:52 localhost systemd[1]: Starting upload files into dropbox...
Apr 13 23:58:52 localhost bash[117]: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Apr 13 23:58:52 localhost bash[117]: Dload  Upload   Total   Spent    Left  Speed
Apr 13 23:58:52 localhost bash[117]: 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: content.dropboxapi.com; Un
Apr 13 23:58:52 localhost systemd[1]: upload.service: main process exited, code=exited, status=6/NOTCONFIGURED
Apr 13 23:58:52 localhost systemd[1]: Unit upload.service entered failed state.
Apr 13 23:58:52 localhost systemd[1]: upload.service failed.&lt;/PRE&gt;How to solve the issue when to upload file into dropbox at shutdown?</description>
    <pubDate>Wed, 29 May 2019 09:13:57 GMT</pubDate>
    <dc:creator>luofeiyu</dc:creator>
    <dc:date>2019-05-29T09:13:57Z</dc:date>
    <item>
      <title>Could not resolve host: content.dropboxapi.com when to upload file at shutdown</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Could-not-resolve-host-content-dropboxapi-com-when-to-upload/m-p/272459#M16175</link>
      <description>I want to upload file into my dropbox when my pc is shutdowning.&lt;PRE&gt;sudo vim  /etc/systemd/system/upload.service
[Unit]
Description=upload files into dropbox
Before=network.target shutdown.target  reboot.target
Requires=network-online.target

[Service]
ExecStop=/bin/true
ExecStart=/bin/bash  /home/upload.sh 
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target&lt;/PRE&gt;And the upload.sh script.&lt;PRE&gt;cd  /home
curl -X POST https://content.dropboxapi.com/2/files/upload \
            --header "Authorization: Bearer xxxx" \
            --header "Dropbox-API-Arg:  {\"path\":\"/test.txt\",\"mode\":{\".tag\":\"overwrite\"}}" \
            --header "Content-Type: application/octet-stream" \
            --data-binary @"test.txt"&lt;/PRE&gt;`bash upload.sh` can executed successfully,and file uploaded into my dropbox.&lt;PRE&gt;sudo systemctl enable upload service  &lt;/PRE&gt;To reboot my pc.&lt;PRE&gt;sudo journalctl -u upload 
Apr 13 23:58:52 localhost systemd[1]: Started upload files into dropbox.
Apr 13 23:58:52 localhost systemd[1]: Starting upload files into dropbox...
Apr 13 23:58:52 localhost bash[117]: % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Apr 13 23:58:52 localhost bash[117]: Dload  Upload   Total   Spent    Left  Speed
Apr 13 23:58:52 localhost bash[117]: 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: content.dropboxapi.com; Un
Apr 13 23:58:52 localhost systemd[1]: upload.service: main process exited, code=exited, status=6/NOTCONFIGURED
Apr 13 23:58:52 localhost systemd[1]: Unit upload.service entered failed state.
Apr 13 23:58:52 localhost systemd[1]: upload.service failed.&lt;/PRE&gt;How to solve the issue when to upload file into dropbox at shutdown?</description>
      <pubDate>Wed, 29 May 2019 09:13:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Could-not-resolve-host-content-dropboxapi-com-when-to-upload/m-p/272459#M16175</guid>
      <dc:creator>luofeiyu</dc:creator>
      <dc:date>2019-05-29T09:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Could not resolve host: content.dropboxapi.com when to upload file at shutdown</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Could-not-resolve-host-content-dropboxapi-com-when-to-upload/m-p/272643#M16188</link>
      <description>Based on the error message you posted, this is failing because your machine was unable to look up the 'content.dropboxapi.com' host. That's the correct hostname, and it is resolving correctly for me.&lt;BR /&gt;&lt;BR /&gt;That being the case it appears to be an issue with your DNS server, which is out of our control. Please check on your DNS server to see why it is not returning a result for content.dropboxapi.com.</description>
      <pubDate>Mon, 16 Apr 2018 15:29:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Could-not-resolve-host-content-dropboxapi-com-when-to-upload/m-p/272643#M16188</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-04-16T15:29:13Z</dc:date>
    </item>
  </channel>
</rss>

