Is there a way to “ping” the S3 URL to see if a valid file is stored in the URL? Due to cross-domain issues, standard AJAX calls do not work.
The file I want to check is a binary file.
< p>You can solve the cross-domain problem by specifying the CORS policy on the bucket.
I recently changed the naming convention of the files in the job folder. Because when the user tries When downloading a specific file, I need to support both the new naming convention and the old naming convention. I need to check whether the new naming standard URL exists, and if it does not exist, download from the old naming standard URL.
< p>Is there a way to “ping” the S3 URL to see if a valid file is stored in the URL? Due to cross-domain issues, standard AJAX calls do not work.
The file I want to check is a binary file.
You can check AWS The headObject() method in the JavaScript SDK, but if the file is publicly accessible, you can also use a simple HEAD request (using ajax).
You can specify the CORS policy on the bucket To solve cross-domain issues.