could anyone help me with uploading a file through a PUT request to my S3-compatible storage please? So I’m using a file uploading element, and tried binding the element’s value-variable into my API request. However not really sure what goes where, I tried adding a “content”-key and as a value the binding to the file object. This doesn’t work. There is a record created in my S3, but it’s corrupted and missing the content, i.e. the file itself and just few bytes in size. Also tried several variations, but wasn’t successful.
Are you uploading the file in the previous workflow action?
WeWeb (currently**) uploads the file to their CDN with a workflow action.
**I believe that WeWeb is working on updating the element so that you can just store the file into your database directly, but right now it goes into the WeWeb CDN first.
If you want to store the file in the S3 Storage, you are going to need to use the workflow action to upload the file to WeWeb CDN, and then get it into S3.
The result of the upload action contains the URL of the file.
I’m not familiar with S3, but do they have an endpoint that you can supply a URL to that will then take the file and bring it into S3?
If so, that would be something you could just do on the next workflow action.
If I’m understanding your question correctly, I think the above will work. And, checkout these links on the upload element:
thanks a lot! So I’m not uploading the pdf to WeWeb, but only using the file upload element to pick the pdf (it creates a file object). I want to use this file object and upload directly to my S3 endpoint. I know it’s there but don’t really know how to properly place it into in a “API-request”-workflow. The same request does work with Postman, however with Postman I just select the file of course.
It does work though when following the tutorial under ⬆️ File Upload, using a custom JS workflow including creating a new formData and using axios.put for uploading. However the issue I’m lacking JS knowledge and it keeps on breaking when adding additional headers to my request, see screenshots
It does work with just the content type header, but I need the additional header X-Amz-Acl (for setting S3 permissions)
As mentioned in my first post, if I use the other option, API request workflow, it does create a file in my bucket as well, however it’s missing the content (the file object) itself and it’s just a few bytes in size.
I’m not very knowledgeable about JS. I got through the first step, but when trying to create a record in my back end (Xano), I ran into this error: “Missing param: type”. I am trying to upload a word doc through Xano’s “Upload an Attachment” end point.
My next question is going to be about uploading multiple files at one time directly to Xano, so if anyone has an answer for that, it’d be much appreciated!
Any news on this update. Ideally, I would like to bypass the weweb CDN completely when making the upload. Also on that note, do you know if there is a variable we can access to display the file that has been uploaded as an image to the user before we even store it? It must be stored somewhere in the application before uploading, no?