2 Replies - 4626 Views - Last Post: 20 January 2011 - 09:04 AM

#1 jameelmca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 20-January 11

Multiple file Upload javascript or jQuery

Posted 20 January 2011 - 08:43 AM

Hi,

I need multiple file upload as like mediafire file upload pls help me ,..

This post has been edited by jameelmca: 20 January 2011 - 08:45 AM

Is This A Good Question/Topic? 0
  • +

Replies To: Multiple file Upload javascript or jQuery

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1184
  • View blog
  • Posts: 7,254
  • Joined: 07-September 06

Re: Multiple file Upload javascript or jQuery

Posted 20 January 2011 - 08:48 AM

Well, what have you attempted thus far? (post any code attempts you have made) Because we aren't just going to give you the code and send you on your merry way. You have to show some effort, and in most cases will be doing the majority of the work.

Please post your code in the code tags like so:
:code:
Was This Post Helpful? 0
  • +
  • -

#3 jameelmca  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 20-January 11

Re: Multiple file Upload javascript or jQuery

Posted 20 January 2011 - 09:04 AM

View PostBetaWar, on 20 January 2011 - 08:48 AM, said:

Well, what have you attempted thus far? (post any code attempts you have made) Because we aren't just going to give you the code and send you on your merry way. You have to show some effort, and in most cases will be doing the majority of the work.

Please post your code in the code tags like so:
:code:



i used jQuery first in the included file (jsp) i have use mootools for file upload that provided by the fancy file uploaded (multiple) when i am going to this inner page other jquery is not working

Event in this post attachment also not having multiple file upload...


	<script type="text/javascript" src="/js/mootools.js"></script>
	<script type="text/javascript" src="/js/Swiff.Uploader.js"></script>

	<script type="text/javascript" src="/js/Fx.ProgressBar.js"></script>

	<script type="text/javascript" src="/js/Lang.js"></script>

	<script type="text/javascript" src="/js/FancyUpload2.js"></script>
	<script type="text/javascript">
		//<![CDATA[

var flag=0;
var browserName=navigator.appName;
var evt="click";
if (browserName=="Microsoft Internet Explorer")
{
  evt="domready";
}
 
addEvent(evt, function() { // wait for the content
	// our uploader instance 
	if(flag==0){
	var up = new FancyUpload2($('demo-status'), $('demo-list'), { // options object
		// we console.log infos, remove that in production!!
		verbose: true,
		
		// url is read from the form, so you just have to change one place
		url: $('form-demo').action,
		
		// path to the SWF file
		path: '/images/Swiff.Uploader.swf',
		
		// remove that line to select all files, or edit it, add more items
		typeFilter: {
			//'Images (*.jpg, *.jpeg, *.gif, *.png)': '*.jpg; *.jpeg; *.gif; *.png)'
			
		},
		
		// this is our browse button, *target* is overlayed with the Flash movie
		target: 'demo-browse',
		
		// graceful degradation, onload is only called if all went well with Flash
		onload: function() {
			$('demo-status').removeClass('hide'); // we show the actual UI
			$('demo-fallback').destroy(); // ... and hide the plain form
			
			// We relay the interactions with the overlayed flash to the link
			this.target.addEvents({
				click: function() {
					return false;
				},
				mouseenter: function() {
					this.addClass('hover');
				},
				mouseleave: function() {
					this.removeClass('hover');
					this.blur();
				},
				mousedown: function() {
					this.focus();
				}
			});

			// Interactions for the 2 other buttons
			
			$('demo-clear').addEvent('click', function() {
				up.remove(); // remove all files
				return false;
			});

			$('demo-upload').addEvent('click', function() {
				up.start(); // start upload
				return false;
			});
		},
		
		// Edit the following lines, it is your custom event handling
		
		/**
		 * Is called when files were not added, "files" is an array of invalid File classes.
		 * 
		 * This example creates a list of error elements directly in the file list, which
		 * hide on click.
		 */ 
		onselectFail: function(files) {
			files.each(function(file) {
				new Element('li', {
					'class': 'validation-error',
					html: file.validationerrorMessage || file.validationerror,
					title: MooTools.lang.get('FancyUpload', 'removeTitle'),
					events: {
						click: function() {
							this.destroy();
						}
					}
				}).inject(this.list, 'top');
			}, this);
		},
		
		/**
		 * This one was directly in FancyUpload2 before, the event makes it
		 * easier for you, to add your own response handling (you probably want
		 * to send something else than JSON or different items).
		 */
		onFileSuccess: function(file, response) {
			var json = new Hash(JSON.decode(response, true) || {});
			
			if (json.get('status') == '1') {
				file.element.addClass('file-success');
				//file.info.set('html', '<strong>Image was uploaded:</strong> ' + json.get('width') + ' x ' + json.get('height') + 'px, <em>' + json.get('mime') + '</em>)');
			} else {
				file.element.addClass('file-failed');
				file.info.set('html', '<strong>An error occured:</strong> ' + (json.get('error') ? (json.get('error') + ' #' + json.get('code')) : response));
			}
		},
		
		/**
		 * onFail is called when the Flash movie got bashed by some browser plugin
		 * like Adblock or Flashblock.
		 */
		onFail: function(error) {
			switch (error) {
				case 'hidden': // works after enabling the movie and clicking refresh
					alert('To enable the embedded uploader, unblock it in your browser and refresh (see Adblock).');
					break;
				case 'blocked': // This no *full* fail, it works after the user clicks the button
					alert('To enable the embedded uploader, enable the blocked Flash movie (see Flashblock).');
					break;
				case 'empty': // Oh oh, wrong path
					alert('A required file was not found, please be patient and we fix this.');
					break;
				case 'flash': // no flash 9+ :(/>
					alert('To enable the embedded uploader, install the latest Adobe Flash plugin.')
			}
		}
		
	});
	flag=1;
	}
 });
 	//]]>
	</script>


Mod edit - Please :code:

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1