cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you’ve changed your email address, now's the perfect time to update it on your Dropbox account and we’re here to help! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

filesGetTemporaryUploadLink - 404

filesGetTemporaryUploadLink - 404

newBox
New member | Level 2

Hi! 

 

I'm user of dropbox basic and I'm generating upload link but the link following to 404 page.

I have one folder /home/products and one app /Apps/xxx with folder /products

I did try every combination to get proper link but its impossible for me.

here is list of paths witch I did provide 

 - /products

 - /products/somefilename.txt

- /Apps/xxx/

- /Apps/xxx/products

- /Apps/xxx/products/somefiname.txt

 

what is proper path in my case ? please help

 

const dbx = new Dropbox({ accessToken: token });
return dbx.filesGetTemporaryUploadLink({duration: 14000, commit_info: {path: '/Apps/xxx/products/text.txt',
"autorename": true,
"mode": "add",
"mute": false,
"strict_conflict": false
}})
2 Replies 2

Здравко
Legendary | Level 20

@newBox wrote:

...

I'm user of dropbox basic and I'm generating upload link but the link following to 404 page.

...


Such a link should not follow anywhere! Or you should not expect such a thing at least.

This is one shot link for single use only!!! If even only try open such a link in web browser by simply put it on the address line, that immediately invalidates it (it's consumed already)!

Such a link may be used in post request and this request puts in file, you denoted on link creation, exactly what carries the request body (focus on exactly - if the content is encode somehow in the body, exactly the same will get in the file). Many people get confused by this and think the file becomes damaged.

 


@newBox wrote:

...

what is proper path in my case ? ...


Only file paths! There is no way to upload a folder (as is in some of your tries).

You may try start with something relatively simple. Pass as path something like '/test.txt' and change mode to "overwrite". Once you have the new link, execute a code like:

 

fetch(yourLink, {
  method: "POST",
  headers: {"Content-Type": "application/octet-stream"},
  body: "hello world"
})

 

Where the variable 'youLink' above is... your link just received before. Once executed, take a look on your Dropbox folder (either online dropbox.com or on the local one). Does there come up a file test.txt? 🤔 What does it contain if so? 🙂

Hope this clarifies the things.

Greg-DB
Dropbox Staff

@newBox As Здравко noted, you should not attempt to open the temporary upload link directly in a browser; attempting to do so will return a 404 to the GET request.

 

As for the path, if your app has the "app folder" access type, you should not include the path to the app folder itself in the 'path' value. Dropbox will automatically interpret your path values as relative to the app folder when using an app with the app folder access type. So for example, if you are using an app with an app folder, and want to upload to "/Apps/<app_folder_name>/products/somefilename.txt", you should only specify "/products/somefilename.txt".

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?