Create File > File URL Works While Testing but Not During RUns

Hello all,

I use the Files Helper (v0.0.7) to create a file form some CSV data and then send the resulting file link in an email.

When I in TEST mode, the email gets properly produced and I can download the file from the link. However, when the flow runs, it does NOT provide a valid link to the file.

Failing Example During RUN Mode:

Any help will be very much appreciated :).

(As a new user I can only add 1 embedded media item per post :))

Working Example in TEST Mode:

Hello @petarm, welcome to our community :star_struck:

Basically the links (URL) you see when you test your step was meant for you to just see the output of your step while testing in your browser, but it is not intended for use in production runs, so you would basically need to upload the file you wrote to google drive or dropbox or any other file hosting services and use the link from there.

Got it!

Thank you very much! I will give that a try :).

1 Like

Hey there!

I created a setep to Create File in Google Drive and I am getting the same behavior - it is working correctly and generating a link while Testing, but in Production runs, it does not include the right link.

I get the same behavior, even though the file is saved in Google Drive.

When I click the Test Step button, I get a valid URL that works, though it is from my server rather than the actual link from Google Drive.

https://**CENSORED**.io/api/v1/step-files/signed?token=eyJhbGciOiJIUzI1NiIsInR5**CENSORED**HAdBM

I am probably missing something simple here…

I am having the exact same issue… See the right side, which is what happens when i test the step, vs the left side which is the output when I am testing the run… The link provided when I test the step gives me a download link for the file, not really anything that would work to add to Google Drive as far as I can tell…

The idea here is that the Create File Piece is used to prepare a file to be uploaded to another service like Google Drive, Dropbox, SFTP, S3 storage, etc.

Like you, I originally thought that it was a way to create the file, and I could just use it as the Download link for that file. However, that is not the case, as the file is not generated during Production runs.

I believe this is by design because Activepieces does not aim to be a file storage solution.

I then tried to use the Google Drive solution. However, in my case, Google Drive will not work. This is because the Google Drive API only supports providing Download links for binary files (such as a PDF). I was generating a CSV file (text file), and therefore the response I received from the Google Drive - Set public access action did not return a download URL.

I solved this by using the Create file piece to prepare the file for upload. Then, I used the Amazon S3 > Upload File action to upload the file to my S3 provider. My S3 provider does not allow creating public buckets, so I also had to make an API request to get a pre-signed URL.

The only drawback is that the pre-signed URL can be valid for a maximum of 7 days.

I have the same issue when creating a file with Google Drive as well. There appears to be no way to do anything with that file. With the Google Drive method the output isnt file://xxxxx but the cloud.activepieces URL that leads to a download file that is a random string followed by .false, instead of filename.html as I have instructed it to do.

Here is output to slack:
Download Original Doc: https://cloud.activepieces.com/api/v1/step-files/signed?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEifQ.eyJmaWxlSWQiOiJQb1RxU2dWM0YxWW5sN3p0azZRazQiLCJpYXQiOjE3MTg3NDkxMzEsImV4cCI6MTcxOTM1MzkzMSwiaXNzIjoiYWN0aXZlcGllY2VzIn0.P_DF2Z1c58o0kLzwtwKZ6qXrtW8dMxvtRHDRLfKZPwo

I actually just opened it and it had the HTML, which is good, but not what I was going for with that filename…

That is an interesting solution, and I was thinking that I could do what you said originally, but it made more sense to me that it creates the file and then you have to do something with it internally (like upload to S3 or Google Drive, etc.) and then utilize the file.

The STRANGE thing here is it IS creating a link and allowing me to download it. If you click the link above, it will allow you to download the file… From ActivePieces URL… It just appends “.false” to the end of the file.

Here is what I am trying to do:

  1. Create a file on Google Drive (with the content from the piece) = this is working fine
  2. Set public access (also appears to be working fine and creates a URL, but it, again, is an active pieces URL NOT the Google Drive URL, strangely enough)
  3. Get the URL from Google somehow (I tried “Read” as in your example, but that also returns an AP URL…)
  4. Provide URL via Slack (working but the URL from activepieces appends “.false” to the end of it)

https://cloud.activepieces.com/api/v1/step-files/signed?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjEifQ.eyJmaWxlSWQiOiI5TXhvRVRDOU5mZExoY2xhbHlHSmsiLCJpYXQiOjE3MTg3NTA2MDUsImV4cCI6MTcxOTM1NTQwNSwiaXNzIjoiYWN0aXZlcGllY2VzIn0.YwtTaK1M6JxpwGZkakzpaJDyEJzCRJD4Q4tuQg31mZE

Is it feasible to just dump the file contents into a Code block in the Slack message?

Alternatively, you can use the Text Helper piece, to Replace .false with nothing and use the output of the piece as the URL to send in the Slack message.

Even if this turns out to be a defect and it gets fixed, the Replace should not break anything if it doesn’t find the .false in the URL.

That is actually a really good idea. 2 issues, I do not have the paid slack version, so I lose messages after a set amount of time, so if I need to look back in the future, like 3 months down the line, for some reason, I wont have it to refer to. And 2, I am not 100% sure I can dump hundreds of 2k word files into Slack, but I might test it in the meantime.

It still kind of defeats the idea of the team being able to quickly and easily pull up the HTML in a browser window by clicking on it. But might be a temp workaround.

This video has a little more detail of what I am doing. Maybe I am still doing something incorrectly.

The thing is that it doesnt return a URL that is my filename, it is a random string, that leads to the URL. So there is nothing to find and replace.

Ah, yeah I see what you mean. That’s interesting - not really sure how to solve for that.

Yeah, I was wrong, it is giving me the AP URL during testing, and file://… during regular runs…

I do not know why after uploading to Drive and then changing permissions, it would give a URL from AP instead of Google Drive, ever… Obviously if someone wants to add global permissions, they are most likely going to want the shareable link to that file…

I think the .false is something on the AP side that is supposed to be indicating something internally, as opposed to something that we are supposed to be seeing. This has to be a bug.