Closed artpylon closed 7 years ago
there should be a url where the file is stored on aws after it has been uploaded no? can't you just create a link to that url?
I am getting back one url from s3, because the content type i send when storing that file is octet-stream, it downloads when clicked.
If the content type sent to s3 matched the file type, it would open. That's my understanding at least.
Within my s3 account i can change the content type and it changes the link within the UI. When I match the content type to the file type, the link opens instead of downloads. That's what I'm basing this on.
what is the url you get back?
Is it a project requirement that both open and download be offered, or just one of the two?
i think one or the other is fine
My reading of the requirements is that we need to provide the user with both a download and an open link for the files that have been uploaded, is this correct?
Currently, I am getting back a link that downloads. I am unsure how to also get a link that opens.
I believe I know how to get either ONE of them, but not both.
My understanding is that it is based on the content type. Currently, the contentType I am passing to aws is octet-steam. Octet-stream seems to be the content type provided if the type of the file cannot be discerned by mime. This is as expected because I am defining content type with the obscured file name that has no extension. If I were to pass in the file's original name, such as myimage.png, mime would return the content type image/png and the link I get back would open instead of download.
If both open and download are requirement, I need help getting back both urls.
My current aws-upload file is below, it seems like I would need two s3Upload functions, one to upload the file and get the download link and another to get the open link (by passing in the other content type). When I get the second response from s3 I would add the open link to the existing file created by the first s3Upload function instead of creating another new file. However, it seems like there's a better solution.