Closed garysassano closed 1 month ago
https://ion.sst.dev/docs/start/aws/astro/#3-create-an-upload-form
window.location.href = image.url.split("?")[0] || "/";
this line is saving file in local machine example is correct and works fine maybe you are doing something wrong?
You're saying the example sets up an unused S3 bucket and has an "Upload" button that doesn't actually upload to S3. Instead, it takes a file from the user's computer and saves it somewhere else, still on their computer? This seems illogical and confusing.
Yeah try commenting out the line @zohaibakber said and see what's going on
Commenting the line works indeed, but I'm not sure I understand why that's present.
It shows that the file was uploaded and that you can download it back.
The "Upload" button's current behavior of prompting to save the file locally is counterintuitive. I would normally expect a popup ("File upload successful" or an error message) after clicking "Upload".
You could add a dropdown menu listing files in the bucket and a separate "Download" button would provide a clear and intuitive way to access uploaded files.
Yeah I might change this at some point. For now it's a very simple demo that shows that a file is getting uploaded correctly.
You're saying the example sets up an unused S3 bucket and has an "Upload" button that doesn't actually upload to S3.
It uploads to S3, then tells your browser to open that file from S3, but the browser decides to download the file from S3.
When clicking the "Upload" button, it opens the "Save as" dialog window and then saves the file to my local instead of uploading it to S3.