Skip Navigation LinksHome > Categories > Code from a Category

Adding files to the server without reloading the page



User Name: serfcompany
Name: Serf
Contact Me: www.datawebcoder.com
Home Page: www.datawebcoder.com
php,mysql,javascript,html,css. Preferable working with Zend Framework. Good know javascript. I worked with various, javascript frameworks such as(jquery, YUI3, extjs, sencha touch). [More]
Viewed Times: 2273
Add Date: 02/05/2012
Today we will learn how to upload files without having to press the button to send, as we will be able to control which files should be, what does not, download the file based on parameters. We have the ability to upload multiple files in succession. You can download the source code for the link at the end of this note. So, let's begin.

First of all, connect the necessary scripts, styles, and other files. To do this, I organized such a structure.


In the scripts kept the necessary scripts, styles - styles, uploader - flash, which interacts with the browser, the picture for downloading and cancel button handler in php and upload_dir folder to store uploaded files.

Now put it all together.

In addition to connecting the necessary files, here is to focus on lines 12 - 23, in which we are passing our boot some of the parameters, namely:

'uploader': a place where flash is stored

'script': processing the script to php

'folder': the place to be injected into uploaded files

'cancelImg': Picture to cancel downloads

'buttonImg': picture, which replaces the standard button 'Review

'auto': means that the download will take place immediately after you select the file (s)

'multi': note the opportunity to select multiple files

'onComplete': handle events that occurred after the sample files, more precisely, we simply display a picture, I think that is very suitable for creating kakih-nibud Galerius


It's very simple, and above all very functional. Hitherto I have not seen such components only once saw a discussion on the Habré, which said about another similar component.


Link to the plugin http://www.uploadify.com/

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Details**:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
 
    
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.