[英]PHP : Joomla:- File upload issue issue in “iPhone devices” (Uploading the same image from different file upload fields) while working fine on desktop
I am facing an issue on all iPhone devices (iphone 4, 5, 6 & iPad). 我在所有iPhone设备(iphone 4、5、6和iPad)上都遇到问题。 I have created a page:
我创建了一个页面:
http://joomla.iworklab.com/aquadam_newtheme/index.php/rfq-construction-stage/constructionstageform
http://joomla.iworklab.com/aquadam_newtheme/index.php/rfq-construction-stage/constructionstageform
On this page, there many file upload fields but only three file upload fields are taken the same image on iphone devices & others file uploads fields are working fine. 在此页面上,有很多文件上传字段,但在iPhone设备上仅拍摄了三个文件上传字段,并且其他文件上传字段正常工作。 File upload fields, those taken same image are given below:
文件上传字段,拍摄的相同图像如下:
<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">
Only these three fields are uploading the same image on server while remaining fields are working fine. 只有这三个字段在服务器上上传相同的映像,而其余字段工作正常。
I have attached the snapshot of fields those are creating same image issue in iphone devices as given below: 我已附上正在在iphone设备中创建相同图像问题的字段的快照,如下所示:
& snapshot of remaining fields on same page, those are working fine on all devices (including iphone) as given below: 和同一页面上其余字段的快照,如下所示,它们在所有设备(包括iPhone)上均能正常工作:
Please suggest anyone, how can I fixed this issue? 请提出建议,我该如何解决此问题?
Thanks in advance :) 提前致谢 :)
I have got the exact cause of this issue: 我有这个问题的确切原因:
"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."
“在iphone中,所有文件上传输入将自动设置为图像名称'image.jpg',因此,当您在同一目标文件夹中上传图像时,它将指向同一图像。”
Hence final solution for it, is either you use unique time stamp with image name at the end of image upload (like: md5(microtime(true)), or md5(rand(true))) or use different destination name for each image. 因此,最终的解决方案是在图像上传结束时使用带有图像名称的唯一时间戳(例如:md5(microtime(true))或md5(rand(true))),或者为每个图像使用不同的目的地名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.