I upload an avatar to the site. How to transfer to a separate php array $ _FILES via javascript?

  • No way - only if the flash overtake in binary form and then on the server to collect back. - metazet
  • No way :) - Alex Kapustin

2 answers 2

It is possible and on old browsers without any additional plugin, at least in ie6. The usual form with the file selection field, when you click on the submission, JavaScript creates an invisible iframe and adds the attribute target = " name_oframe " to the form . The server accepts the file and returns some JavaScript code to this iframe that causes some JavaScript function previously written in the main window (not in the iframe) that makes all changes on the page that should occur after the file is loaded. Well, there is still swfuploader (it seems so called)

    1. Before asking a question, use the search, such questions have already been raised.
    2. I duplicate my answer:

    Not so long ago, they asked for another resource or it’s possible, so I made an example of a multi-drop (several files at a time) on ajax

    I think it will help. Naturally, the browser should support FileAPI

    • Thanks, I will try. - oleg_ismaylov