Best answer

File uploaded in Amazon S3 is just plain text not jpeg/pdf format

  • 15 December 2022
  • 8 replies
  • 725 views

Hi, We’re setting up any submission from Gravity Forms should be stored in our Amazon S3 bucket. 

The steps are OK as shown here: https://prnt.sc/XLP2QR-LVVGa

But when we start the testing, it’s not creating a folder in the S3 and it just save as text or just plain format. 

Can you advise how can we upload the files inside a folder and it’s in jpeg/pdf files/format?

Thank you,

icon

Best answer by SamB 3 July 2024, 16:51

View original

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

8 replies

Userlevel 7
Badge +12

@webeedeveloper 

From your screenshot it looks like you are trying to upload multiple files at the same time. Zapier can only handle 1 file at a time. Since all those urls put together don’t make 1 valid url, the file is getting interpreted as just a text file.

To upload multiple files, you will need to add 1 file upload action for each file you are trying to upload. 


 

hi @GetUWired thanks for your reply. 

I have corrected it https://prnt.sc/bfQThfyizhST but when uploading to Amazon S3, it’s still not in jpeg file.

Also is it possible to upload multiple files in the same KEY name and they will be group inside a folder?

For example, the key name is the security number. then since there were a lot of files under the same key name, it will be automatically be a folder and files are saved there. 

 

Thank you,

Userlevel 7
Badge +14

Hi @webeedeveloper 

Good question.

If you have multiple files then you can use the Looping app: https://zapier.com/apps/looping/help

 

Help articles for using AWS S3 in Zaps: https://zapier.com/apps/amazon-s3/help

hi @Troy Tessalone 

 

Thanks for your reply. But is it possible the below scenario through Zapier?

Step 1: Sellers of our website are required to submit documents via Gravity Forms. The required fields are social security number, copy of ID, copy of IBAN, copy of Address and copy of Company. 

Step 2: Once submitted: it should create a folder inside our bucket in Amazon S3. The security number will be the name of the folder while the copies of ID, IBAN, Address and Company should be saved there in either JPEG or PDF format. 

I believe, I’ll need to use the Looping app to upload multiple files but kindly confirm if the above is possible. 

 

Thank you. 

Userlevel 7
Badge +14

@webeedeveloper 

Yes, if the links to the files collected by Gravity Forms are publicly accessible.

Userlevel 7
Badge +12

@webeedeveloper 

If you want the file as a JPEG then i would try to specify the Mimetype as such (an acceptable value might be image/jpeg or you can try auto). From the url in your screenshot, that file appears to be a jpg so you would need to explicitly state it should be uploaded as a jpeg

Userlevel 7
Badge +9

Hi friends - I wanted to swing by and share some of what was shared in the support ticket. It confirms a bit of what already discussed here. 🙂:

The "Upload File in Amazon S3" can only handle one file, so since we're passing multiple values into the File field, it assumes we want to create a file, in this case, a .txt file. For multiple files, you would want to add multiple "Upload File" actions, one for each file. However, the problem is the files you mapped isn't file object.
 
File objects are the bundles of data that represent the actual file. This is different from the name of the file or other file attributes. For example, the actual image of an apple is the file object, while the file name might be “apple.jpg”. Please use this page as a reference: https://zapier.com/help/create/basics/send-files-in-zaps. 
 
Furthermore, creating a folder within an Amazon S3 bucket isn't currently supported at this time, so I'm afraid the workflow you're looking to set up isn't possible just yet.
 
While that's not something the app currently offers, I can see that other users are interested in having something similar, so much that it's already one of our feature requests. I've gone ahead and added your vote for this functionality. While I don't have an ETA on when this feature might be implemented, we will notify you via email if it is!

We’ll also be sure to keep the topic updated if/when this gets implemented. Thanks for flagging this in community!

Userlevel 7
Badge +11

Hey folks,

I’m happy to announce that the feature request has been closed! 🎉 So it’s now possible to select folders and sub directories when uploading files to Amazon S3.

In case you missed the email notification that went out about this, here’s what you need to know:

How to Use Folder/Subdirectory Paths in Your S3 Keys:

You can organize your files within S3 by including folder/subdirectory paths in the key. Here’s how you can do it:

  • To upload a file to the root of the bucket: file.txt
  • To upload a file to a specific folder: folder1/file.txt This will place file.txt inside folder1.
  • To upload a file to a subfolder within a folder: folder1/subfolder1/file.txt This will place file.txt inside subfolder1, which is within folder1.
 

Note: Amazon S3 uses a flat namespace. While it appears as though you are creating folders, these are actually part of the key name. The forward slash (”/”) is used to separate different levels of hierarchy in your key.

You can read more about this in Amazon's documentation here

 

We hope you’re able to give this a try in your Zaps soon! If you run into any issues with it please let us know in the Community here or reach out to our Support team directly and we’ll be happy to assist further. 

Until then, happy Zapping! ⚡