PHP :Joomla:- "iPhone devices" 中的文件上传问题(从不同的文件上传字段上传相同的图像),同时在桌面上正常工作
PHP : Joomla:- File upload issue issue in "iPhone devices" (Uploading the same image from different file upload fields) while working fine on desktop
我在所有 iPhone 设备(iphone 4、5、6 和 iPad)上都遇到了问题。
我创建了一个页面:
http://joomla.iworklab.com/aquadam_newtheme/index.php/rfq-construction-stage/constructionstageform
在此页面上,有许多文件上传字段,但只有三个文件上传字段在 iphone 设备上采用相同的图像,其他文件上传字段工作正常。文件上传字段,同图的如下:
<input type="file" name="jform[select_picture1_bt]" id="select_picture1_bt" accept="image/png,image/jpeg,image/gif,image/bmp,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
aria-invalid="false">
<input type="file" name="jform[select_picture2_bt]" id="select_picture2_bt" accept="image/png,image/jpeg,image/gif,image/bmp,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document">
<input type="file" name="jform[select_picture3_bt]" id="select_picture3_bt" accept="image/png,image/jpeg,image/gif,image/bmp,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document">
只有这三个字段在服务器上上传相同的图像,而其余字段工作正常。
我附上了在 iphone 设备中造成相同图像问题的字段的快照,如下所示:
& 同一页面上剩余字段的快照,这些字段在所有设备(包括 iphone)上工作正常,如下所示:
请告诉任何人,我该如何解决这个问题?
提前致谢:)
我已经知道这个问题的确切原因:
"In iphone, all the file upload inputs will automatically set with
image name 'image.jpg' so when you uploading image in same destination
folder then it will pointed to same image."
因此最终的解决方案是在图像上传结束时使用带有图像名称的唯一时间戳(例如:md5(microtime(true)) 或 md5(rand(true)))或使用不同的每张图片的目的地名称。
我在所有 iPhone 设备(iphone 4、5、6 和 iPad)上都遇到了问题。 我创建了一个页面:
http://joomla.iworklab.com/aquadam_newtheme/index.php/rfq-construction-stage/constructionstageform
在此页面上,有许多文件上传字段,但只有三个文件上传字段在 iphone 设备上采用相同的图像,其他文件上传字段工作正常。文件上传字段,同图的如下:
<input type="file" name="jform[select_picture1_bt]" id="select_picture1_bt" accept="image/png,image/jpeg,image/gif,image/bmp,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
aria-invalid="false">
<input type="file" name="jform[select_picture2_bt]" id="select_picture2_bt" accept="image/png,image/jpeg,image/gif,image/bmp,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document">
<input type="file" name="jform[select_picture3_bt]" id="select_picture3_bt" accept="image/png,image/jpeg,image/gif,image/bmp,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document">
只有这三个字段在服务器上上传相同的图像,而其余字段工作正常。
我附上了在 iphone 设备中造成相同图像问题的字段的快照,如下所示:
& 同一页面上剩余字段的快照,这些字段在所有设备(包括 iphone)上工作正常,如下所示:
请告诉任何人,我该如何解决这个问题?
提前致谢:)
我已经知道这个问题的确切原因:
"In iphone, all the file upload inputs will automatically set with image name 'image.jpg' so when you uploading image in same destination folder then it will pointed to same image."
因此最终的解决方案是在图像上传结束时使用带有图像名称的唯一时间戳(例如:md5(microtime(true)) 或 md5(rand(true)))或使用不同的每张图片的目的地名称。