PHP Image / Fileupload: crossbrowser, multiple files, drag and drop?

In 2012, I did not think that loading an image using PHP would cause so many difficulties.

My requirements:

  • upload multiple files
  • cross browser functionality
  • subject to security concerns.
  • depending on the smallest possible additions or extensions
  • drag & drop support (it would be nice, at least)

Available options are available to me:

  • simple loading of one file (or several inputs of one file, but you still have to select each image manually) using only PHP (and, for example, the GD library)

    (+) Pros: a full-featured browser that does not depend on flash, nor on javascript, nor on html5, nor on any add-ons, etc., maximum customizability

    (-) Cons: poor user interface, as there is no support for multiple files, no drag and drop, etc.

  • compromise using, for example, jQuery

    as advertised on many posts and other sites, see this link, for example: http://blueimp.github.com/jQuery-File-Upload/

    (+) Pros: support for multiple file downloads and even drag and drop, among other nice features, mainly for FireFox, Chrome, Safari (see the link for details)

    (-) Cons: only one file selection and no drag and drop for IE (tested on IE6-IE8 independently)

  • HTML5: browser market shares do not seem to be dependent solely on HTML5, still ...

  • Flash: I found many different flash-based bootloaders, but when testing many did not fulfill what they required (for example, select multiple files and cross-browser functions). Two examples that I found useful:

    http://www.uploadify.com/demos/ http://code.google.com/p/swfupload/( see http://demo.swfupload.org/v220/ for demos)

    (+) Pros: those supported by multiple file downloads

    (-) Cons: no drag and drop, depending on the addition of Flash, and I'm not a security expert and not very familiar with the flash, but the swfupload documentation, for example. that they cannot / do not check the MIME type of downloads and rely entirely on checking the file extension)

However, I found statements, for example, google docs uses multiple file uploads not based on flash memory, but still works in IE. Does anyone know how they do this?

My other questions were: did I observe the opportunity? Are all the best options available? Is there any way based on using flash memory, at least to load multiple files in IE (at least v8)? How are you guys doing this? Or does he really wait and hope for an HTML5 breakthrough and now has 5 different users, each of which is optimized for a special browser / adds accessibility?

Thank you in advance!

+4
source share
1 answer

It looks like you have carefully studied your research. A few weeks ago I discovered a similar riddle. Regarding the props of Google Docs, I would really like to see it, because I never found anything like it. Personally, if you are dealing with a younger audience for your site, I would recommend using the jQuery parameter and displaying Firefox or Chrome browser recommendations for IE users. Go Flash for the older crowd, which is likely to be in IE.

Unfortunately, there is no winner I found. But at least with the jQuery option, you avoid Flash and have the potential that IE will work with in future versions. With HTML5, Flash quickly disappears (and a good cure). Now, if this only happens with IE. I mean, let's, like this, that even in IE9 they don’t even come close to their competitors, being standard complaints ??? This is ridiculous.

+2
source

Source: https://habr.com/ru/post/1401049/


All Articles