Fine-uploader in iOS and iPad -


i checked if fineuploader worked on ipad, , mostly, ipad gets single file "image.jpg" returned, every file that's uploaded keeps overwriting previous file. (or uploads 1 file) in case, can behavior fixed on either chrome or safari on ipad?

we using library uploaded images different business requirement , works dream. developing one.

krishna

here code:

i creating endpoint dynamically , uploading files different folders. getting uploaded other platform except ios.

$(document).ready(function () {     $('#s3-fileuploader').fineuploader({         request: {             endpoint: '',             inputname: 'filename',             forcemultipart: true,             paramsinbody: true,             params: {},         },         faileduploadtextdisplay: {             mode: 'custom',             maxchars: 40,             responseproperty: 'error',             enabletooltip: true         },         cors: {             expected: true, //all requests expected cross-domain requests             sendcredentials: false, //if want cookies sent along request             allowxdr: true         },         autoupload: true,         multiple: true,         debug: true,         text: {             uploadbutton: '<i class="icon-plus icon-white">select files</i> '         },         deletefile: {             enabled: false,             forceconfirm: true,         },         validation: {             // allowedextensions: ['jpeg', 'jpg', 'gif', 'png'],             itemlimit: 75         }     }).on('submit', function (event, id, name) {         $(this).fineuploader('setendpoint', endpoint); //set endpoint     }).on('complete', function (event, id, filename, response) {         var $deleteel = $(             '<span class="delete">&#160;&#160;<a href="javascript:;" onclick="deletefile(\'' +             response.deletefileurl + '\',\'' + id +             '\')">delete</a></span>&#160;&#160;');         //when delete element clicked, call "deletefile" api method, passing in file's id         if (response.success) {             $(".qq-uploader").append(                 '<div class="highlight" style="margin-top:8px;margin-right:8px;float:left;width:180px;height:194px; box-shadow:1px 0 0 #f3f3f3, 0 1px 0 #e4e4e4, 0 -1px 0 #f3f3f3, -1px 0 0 #f3f3f3" class="thumb" id="thumb_' +                 id + '"></div>');             //get file name responce             var filename = getfilename(response.getthumbnailurl);             //get file extension             var fileext = filename.split('.').pop().tolowercase();             //create array of available extenions images             var exts = ["csv", "doc", "docx", "xls", "zip", "pdf",                 "txt"             ];             //check if image             if (fileext == 'jpeg' || fileext == 'jpg' || fileext ==                 'png' || fileext == 'gif' || fileext == 'tiff' ||                 fileext == 'tif' || fileext == 'bmp' || fileext ==                 'wbmp') {                 //myother logic             }         }     }); }); 

this due design of ios, not fine uploader. see, ios names files -- "image.jpg" exact.

fine uploader mitigates problem generating level 4 uuid , sending along upload request. parameter in request body qquuid.

i'm guessing server saving files based on filename only. more robust solution use combination of file's uuid , filename ensure users not overwriting files exist.

your server prepend uuid filename:

4a0bc570-0125-11e3-b778-0800200c9a66_image.jpg

or create entirely new folder:

4a0bc570-0125-11e3-b778-0800200c9a66/image.jpg

not ensure users uploading on ios don't overwrite each others' files, ensure 2 users on any platform uploading 2 different files same name won't step on each others' toes.

if have server-/client-side code you'd share, can take peek, modify , post in here answer.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -