PHP: Get file extension not working on uploads to S3

后端 未结 12 636
我寻月下人不归
我寻月下人不归 2020-12-06 17:49

I am using the Amazon S3 API to upload files and I am changing the name of the file each time I upload.

So for example:

Dog.png > 3Sf5f.png

Now I got

12条回答
  •  -上瘾入骨i
    2020-12-06 18:36

    ok here's another try that I used when I had trouble getting the extension on the server side. what I did was, I used javascript to extract the file extension and the send it via post.

    
    
    //rest of the form

    in the next php file you can directly use $_POST['ext'] as extension. hope that helped. let me know if you have any trouble implementing this

提交回复
热议问题