Question

Resolving .txt file upload issue instead of .wav/.mp3 files when downloading from Dropbox link


Badge

Hi,


I work for a music producer and I sort through the loops/samples they get sent in their gmail inbox.

 

I want to make a Zap which

  1. detects a new email with a dropbox link in it
  2. Downloads audio from link (usually a folder containing audio)
  3. Uploads audio to a specified folder (folder name from dropbox should be folder name in specified folder)

I currently have step 1 and 3 working but every time it uploads a .txt file. Majority of files are .wav or .mp3.


Im using a domain name gmail so I have no restrictions


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

15 replies

Userlevel 7
Badge +11

Welcome to the Community, @pmiddleton!

Hmm, are the dropbox links publicly-accessible download link - meaning no login is required in order to download them?

If so, I’d have thought you could use a Formatter (Text > Extract URL) action to extract the link from the email. Then select the link that is extracted by Formatter in the Upload File action. 

That said, if there’s sometimes more than one dropbox link in the email then you may be better off using a Formatter (Text > Extract Pattern) action to extract the multiple dropbox links.


Hope that helps. If you give that a go and run into any trouble let us know. Happy to help further! 🙂

Badge

Hey @SamB,

thanks for the response! The links are available without a login. 
 

if I used a text extractor would it be able to download the audio files or folders to orb audio files in them?

 

 

Userlevel 7
Badge +12

Hi @pmiddleton!

Sam’s suggested a great way to get the urls, but I’m wondering if the issue is with the url itself. 

When you copy a link to share a file in Dropbox, the link will take you to view the file in dropbox, not download the file. For example this link takes you to view a ‘dramatic chipmunk.mp4 file: https://www.dropbox.com/s/dtnigny65o3jk12/Dramatic%20Chipmunk.mp4%20%281%29.mp4?dl=0

The link you need to download the file, you need to change the last character on the link, so it says dl=1 instead of dl=0 eg

 https://www.dropbox.com/s/dtnigny65o3jk12/Dramatic%20Chipmunk.mp4%20%281%29.mp4?dl=1
 

WARNING Clicking this above link will download a dramatic chipmunk video to your computer. It’s a harmless file, but it is very silly. 

 

If you use the download link, not the view link, you should be able to upload the file to any app/folder that allows you to upload files using a link. 

 

If the links in the emails that you have end in dl=0, you’ll need to use Formatter by Zapier and choose the Replace function (under text). When you set up that step, make sure to include the ‘dl=’ piece of the text and not to replace every 0 with a 1.  

 

 

I hope that helps, let us know how you get on!

Badge

hey @Danvers,

 

Thanks for the answer! I have done this now but it seems to still be uploading a text file, inside the text file it has the dropbox link with the changed formatting. 

 

It’s outputting the dropbox link with the changed URL

 

But when I send the file to dropbox its taking the output text and uploading it as a text file. How do I get zapier to download it using that link?

 


Thanks for your help,

Patrick

Userlevel 7
Badge +6

Hi there @pmiddleton,

I’m jumping in to see if I can help!

By any chance, do you have a data mapped in the “Specify File Name” field? If so, could you please try removing that mapped data and test the Dropbox step again.

Please keep us posted! 😊

Badge

Hi there @pmiddleton,

I’m jumping in to see if I can help!

By any chance, do you have a data mapped in the “Specify File Name” field? If so, could you please try removing that mapped data and test the Dropbox step again.

Please keep us posted! 😊

Hey @ken.a,

 

Thanks for jumping in. Unfortuently that didnt work either. Still struggling to find why or how to stop it converting it to txt.

 

Is there a specific way to download the dropbox file in another way?

Userlevel 7
Badge +11

Hi @pmiddleton!

I just tested this with and without adding a specific file extension in the Zap, and in both cases it uploaded the file correctly to Dropbox. So, even doing this without specifying the .mp4 extension, it worked for me:

In Zapier

 In Dropbox

 

You’re trying this exact same process and it’s not working for you?

Badge

Hi @pmiddleton!

I just tested this with and without adding a specific file extension in the Zap, and in both cases it uploaded the file correctly to Dropbox. So, even doing this without specifying the .mp4 extension, it worked for me:

In Zapier

 In Dropbox

 

You’re trying this exact same process and it’s not working for you?

 

Hey @nicksimard apologies for the delayed reply. This still isn’t working for me no.

 

I even removed the formatter section and paste the dropbox link directly in the field like you’ve shown and it hasn’t downloaded. It still uploads it as a .txt file

Userlevel 7
Badge +6

Hi @pmiddleton,

Circling back on your previous screenshot. I noticed something in the file extension. It looks like the file you’re trying to upload is still a .txt file.

ff4c1348127d36714363480834032dd6.png
(view larger)

Could you do us a favor and use this link: https://www.dropbox.com/s/gm5ovwmsx1nfq32/Bussed%2094bpm.wav?dl=1 and please paste it directly into the "File" field in the DropBox action step, and test the action step again.

Please keep us posted! 😊

Badge

Hey @ken.a,

 

When pasting your link it seems to work all good. But when I run the original file from Gmail through a formatter then take the output of that into dropbox, it somehow converts it to a text file?

 

This is what the format is outputting, changing it to dl=1 so that it can be downloaded. 

 

The dropbox link with .wav is then used as the file to upload to dropbox

 

 

Once I test this with dropbox, the file_text_ is the original link, but the file_ext is now a .txt file

 

 

Really confused why this is happening

Userlevel 7
Badge +11

Hi @pmiddleton! 🙂

I suspect that there’s likely an additional space in that File field, just before the selected Output field:
5708f5a89874ac7b2f896f0753cdebb9.png

With file fields they have the ability to create a text file from any text that’s added into the field, so my theory is that it’s reading the space character and deciding that it needs to generate a text file that contains a link to the file.

Can you go into the field and remove any additional spaces that might be there then try testing that Upload File action again?

Keen to know whether that solves it so please keep us posted on how that goes! 

Badge

Hey @SamB,

 

Thanks for the response! I’ve just checked this and there is no space in front.

 

Here is a screenshot of what it’s uploading to the dropbox. Its a text file with the correct download link inside 

 

Userlevel 7
Badge +11

Thanks for checking on that, @pmiddleton. If the link is in the text file then there must be a space or some other hidden character that’s just before the link.

Hmm, in that case I wonder if the space is in the Formatter step that supplies the link to that File field then. Can you check the Input field on the Formatter action for any unwanted spaces/hidden characters, remove them and test the Dropbox action again? 

Looking forward to hearing how that goes! 🙂

Badge

Hey @SamB,


I’ve checked the input field on the formatter and there’s no space in the input field

 

There is no spaces in front of 

  • input in formatter
  • Find + Replace


I don’t believe there is a space in front of the dropbox link in the email either.

Is there a way to extract the link from the email directly? That way there would be no spaces

 

Looking forward to hearing your response!

Userlevel 7
Badge +11

Thanks for trying that, @pmiddleton. That’s very strange indeed, I guess it must be coming directly from the email then. 

There’s a couple of ways, as I mentioned previously you could try using a Formatter (Text > Extract URL) action to extract the URL. But if there’s a possibility that there could be other links in the email then you’d want to try using a Formatter (Text > Extract Pattern) action.

The Regex pattern https:\/\/www\.dropbox\.com\/[^\s]+ should allow the Zap to extract just dropbox links. For example:

8705051baffc146d1b7771e87b4feb6c.png

You can learn more about using Regex to extract content here: 

 

Can you give that a try and let us know whether that gets the link extracted without any additional spaces being added?