cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Update: Find information on Dropbox support during COVID-19 here
Close
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Saving a file with a custom extension

Helpful | Level 5

I need to save a file with a custom defined extension (e.g. test.nc). How can I do that using the Dropbox saver?

1 Accepted Solution

Accepted Solutions
Highlighted

Re: Saving a file with a custom extension

Helpful | Level 5

Apparently, there was a problem with my host configuration. I added MIME types that I need and everything works. So no problem with Dropbox API. It was my fault. Sorry for that.

View solution in original post

6 Replies 6
Highlighted

Re: Saving a file with a custom extension

Dropboxer
Dropboxer

If you're using the Saver via an <a> tag, you can set the "data-filename" attribute on that tag to be the filename, including extension, you want the Saver to use, like this:

 

<a href="URL_HERE" data-filename="filename.ext" class="dropbox-saver"></a>

 

If you're using the JavaScript interface, you can set the filename, including extension, in the "filename" value for the file the files list in the options you supply to the createSaveButton or save method, like this:

 

var options = {
    files: [
        // You can specify up to 100 files.
        {'url': 'URL_HERE', 'filename': 'filename.ext'},
...

 

 

Highlighted

Re: Saving a file with a custom extension

Helpful | Level 5

Hello Greg,

use the JavaScript interface from a server and of course I set the filename, including extension, in the "filename" value for the file in the files list in the options. When I set the filename with extension .txt it works fine. But if I set extension .obj which I need to use the Dropbox fails to save and returns an error: "Job reached maximum retry attempts"

Highlighted

Re: Saving a file with a custom extension

Dropboxer
Dropboxer
Can you share the code to reproduce that issue? Thanks in advance!
Highlighted

Re: Saving a file with a custom extension

Helpful | Level 5

My code looks like your Dropbox Saver sample. In url field I put url of my host with file name including extension at the end. In file name field I put name again with extension. If file has extension .txt everything is fine. But if I change the file extension to .obj  Dropbox is not able to save the file and returns the error that I mentioned in the last post "Job reached maximum retry attempts".

Highlighted

Re: Saving a file with a custom extension

Dropboxer
Dropboxer
This issue doesn't reproduce for me using the sample code and a specified filename that ends in .obj. That being the case, it sounds like it may specific to the URL(s) you're using, so please share that so we can reproduce it and investigate.

If you'd prefer to share it privately, you can do so by opening a ticket here:

https://www.dropbox.com/developers/contact
Highlighted

Re: Saving a file with a custom extension

Helpful | Level 5

Apparently, there was a problem with my host configuration. I added MIME types that I need and everything works. So no problem with Dropbox API. It was my fault. Sorry for that.

View solution in original post

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?