"Download File from URL" in loop causing errors

I’m trying to download multiple files form my google drive via a “Download from URL” node since the regular drive “Download File” doesn’t work. Once the second request for a new file download approaches the “Download from URL” node, an error occurs.
Error:
“Download File from URL: This instance has already started one or more requests. Properties can only be modified before sending the first request.”

Any help would be greatly appreciated.

@FernCard_214

Welcome to the community

May I know the issue with download file? What is not working?

And can you show the screenshot of your sequence?

If you can provide more details that would help

Cheers

@Anil_G I’m looping through a google drive folder, getting the URL for each item and attempting to download them to my Desktop. This is done via a “Download from URL” activity within a “For Each File or Folder (Google Drive)” activity.

Screenshot:

Each file in the google drive is simply a .mp3 file.

@FernCard_214

Please use activities which are under gsuite this is a activity which is to download files from generic url

Cheers

@Anil_G See, that’s the thing. I was using a Download File from the gSuite activities, but I cant seem to find where it downloaded it to. Luckily, I was able to figure it out. The activity saves the file in my users’ temporary directory, so using some rename file activities and move file activities, I could dynamically retrieve the file from its downloaded location, move it to where I need it to be, and rename it to what it’s supposed to be.

@FernCard_214

The download file will give you a ilocalresource output

You can use variable.LocalPath to get the path directly

Hope this helps

Cheers

Alright, here’s the solution. The Download File from gSuite activity, with its Output file set to whatever variable you want. Then you simply use a Move File activity to move your downloadedfile.localPath to wherever you want. Then rename. Picture (if it helps):

the two assign activities are:
tmpfilename = Path.GetFileName(downloadedFile.LocalPath)
newFileLocation = moveLocation + tmpFileName

Variables:
currentItem: type GDriveRemoteItem (The Google Drive item you want to download)
downloadedFile: type GDriveLocalItem (The downloaded Google Drive item)
moveLocation: type String (The path of the folder you want to move the file to)
PS: Make sure it has a \ at the end.
tmpFileName: type String (The filename of the downloaded file)
newFileLocation: type String (The path to the file in the moved location.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.