Cannot create + download files in Studio Web

Hi team,

I have a question that is killing me… I’ve built an App with some wfs attached in 5 minutes and then… 5h already blocked at the end :smiley: … That’s life

Description

I’ve built a simple App where the user uploads a CSV, then I read the content and I generate another CSV to be downloaded… very simple right? :slight_smile:


I’ve made the workflow following this logic:

  1. Use File Uploader to add the file
  2. When added, event trigger workflow reads the content
  3. Then, after Submit button is clicked
  • I do some calculations
  • I generate the final datatable, then the CSV
  • I show the App user the generated CSV to let him download it

Issue

There’s NO WAY to download the generated CSV file, even when I see the “temp” path generated at any run I do so, the file is there
I arrived so far to: Create File + write string to file (final CSV) + assign the local path to it

I don’t want to use Storage bucket since I don’t want to store anything, I tried to set the LocalResource, iResource, AppResource… all variable types mentioned in docs/forums I see and no success, can you help me please?

BTW: Docs for File Downloader are veeeeery short, we need some improvements there

Big hug team!

Just to show you:


File is created at runtime, and I can even get the path so… Please, can you show me how do you manage to download this file?

Hi @jmedinacarbonell

Please use this expression in the editor on Wait for Download activity

System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), “Downloads”)

I don’t use this activity and “Downloads” folder is nither used here. It’s an App and when you create local files at runtime they are placed in “temp”.

But you gave me an Idea, I’ve just tried to add a Delay of 30 secs + placing the download activity in a new page (JIC it helps forcing the page refresh)… Nothing happens


@jmedinacarbonell

Got you,

so before calling the Download Files activity, add a small retry loop that keeps checking if the file actually exists in the temp path you’re getting.

Add a simple ‘File Exists’ check that retries a few times.

Once the file is confirmed to exist, then run your download step.

If the direct path still doesn’t work, try pulling the file using a directory like

Example : Directory.GetFileSystemEntries(tempFolderPath, “.”, SearchOption.AllDirectories)(0)