GithubHelp home page GithubHelp logo

moxiecode / plupload Goto Github PK

View Code? Open in Web Editor NEW
5.6K 233.0 1.4K 10.14 MB

Plupload is JavaScript API for building file uploaders. It supports multiple file selection, file filtering, chunked upload, client side image downsizing and when necessary can fallback to alternative runtimes, like Flash and Silverlight.

Home Page: http://www.plupload.com

License: GNU Affero General Public License v3.0

JavaScript 91.44% HTML 7.31% CSS 1.25%
plupload file-upload file-utility

plupload's People

Contributors

afraithe avatar aganov avatar ahmednuaman avatar boztown avatar cdsboy avatar claushellsing avatar dsteinbrunner avatar eegee avatar gernotk avatar gonchuki avatar gwjwin avatar iepathos avatar irregularshed avatar jamie-pate avatar jayarjo avatar jigfox avatar joris-van-der-wel avatar jrowny avatar justinrocket avatar jwendell avatar marekstachura avatar ndmarcel avatar patforg avatar peterdavehello avatar prg avatar rickharris avatar skalooza avatar spocke avatar sspencer avatar thardyman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plupload's Issues

Expected Hexadecimal Digit error in IE

I consistently get the error in the title under the following conditions:

Browser: IE8
Runtime: Flash
OS: Windows 7 64bit

After clicking "Start upload", the upload fails at 26%. The filesize of the partially uploaded file is exactly one quarter of the expected size.

This happens both with my integration of the uploader and the examples provided in the download (but NOT the example on the Plupload website).
Silverlight in IE8 works fine, and Flash in Opera, FF3.6 and Chrome all work perfectly.

Custom file path issues

Hello,

I am excited to get plupload working in our project. I wanted to ask if it is possible to include a dynamically generated directory to save the files into? We are creating a system in which each element can have multiple files associated with it. What we want to do is create a custom directory for each of these elements where the files associated with that particular element will be stored. Thanks for your help.

Silverlight upload progress OSX

The silverlight handler does not fire progress events during duration of upload, only at beginning and on completion. Tested on osx 10.6 using silverlight plugin 3.0.50106.0 with firefox 3.6 and safari 4.0.4 (6531.21.10). tests on a windows xp sp3 machine using IE8 DO fire the progress events properly. preliminary searches on HttpWebRequest AsyncCallback issues on osx have yielded no definitive results.

from what i can tell, silverlight onprogress calls back 4 times very quickly, then stops. all the while, the file seems to upload, then the complete callback is fired. I tried commenting out the percent>lastpercent checks in the requeststreamcallback method in filereference.cs and after a quick rebuild had the same results.

odd thing is that requeststream.write is obviously working in the same loop, appending the file bytes to the stream....... maybe onprogress is being called too quickly? or an error is killing further executions of onprogress?

Can't change target_name in v1.1.1

I'm try to set value (with file extension), but it resets to id.tmp

Maybe this is not issue, but make troubles.

Code:
uploader.bind("UploadFile", function(up, file) {
...
file.target_name = file.id + '.' + ext;
});

Html4 Runtime

I am trying to test out the html4 runtime - I am sitting here with Charles Proxy Debugger and looking at the Raw request and the Multipart data is empty.

I am using FF 3.6
Plupload 1.1

Integration problems

I'm creating a GWT wrapper for plupload for my project Mollify (http://www.mollify.org), and already have a first working version. There are few things I've encountered so far:

  1. I have draggable dialogs, which means that the browse button moves. Naturally the shim should move along, but it doesn't do that automatically. It does trigger the refresh event, is there something I should do in that event to make it move?

  2. Concerning the same dialog, if it happens to be modal, plupload inserts the runtime div too low (right to the body). When the runtime panel is below the dialog (or the glass panel), it never gets any mouse events. I tried to fix this by modifying your lib so that I give it the element id where runtime should be added to, and it worked except for that the coordinates were not correct anymore. Any plans on supporting this kind of application?

  3. I'm developing with MAMP that uses port 8888, and flash runtime just won't work there because it seems to consider such host an alien. The error is "Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.]", which relates to cross site scripting, although this clearly is not the case here.

[v1.2.1] Handling of filenames with mutiple full-stop characters

Hi,

I tried debugging this on v1.2.2 using the un-minified version but I can't even get it to initialize properly so before I spend days dissecting and learning - perhaps you guys can locate the issue ad-hoc.

What happens is this:

a) Add a file to the queue which contains multiple full-stop characters in the name (e.g. "a.b.c.doc")
b) In the FilesAdded event I can see that the file has been added to the files array of the Uploader
c) When I invoke splice to remove the element and monitor the FilesRemoved event I can see that the files array of the Uploader object is empty and so is the files argument in the event.

Two things here:

a) The documentation states that the second argument of FilesRemoved is an object of type file when in fact it is an array of type file.

b) The above issue occurs only with files that have more than one full-stop character in the name. In all other cases it works.

Hope this helps ;-)

FIrefox 3.0.19 on Ubuntu 9.04 HTML5 upload does not work

Checked on the runtimes test page (http://www.plupload.com/example_all_runtimes.php) and though the form for HTML5 is displayed and a file can be selected, it fails to upload.

The javascript error is displayed below:
[Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://www.plupload.com/plupload/js/plupload.full.min.js :: anonymous :: line 1" data: no]
http://www.plupload.com/plupload/js/plupload.full.min.js
Line 1

Request: Store active runtime name in variable

On successful init of a runtime, store the name of the runtime in a variable so it can be easily checked for use of custom interfaces, dialogs, etc.

Maybe there's already a way to get this, but I cannot for the life of me figure out how.

For now, I've edited callNextInit to store the variable in (res && res.success)

Upload a directory

instead of selecting individual files, make it possible to select recursively a directory.

Scrambled uploads on Flash

Seems that the UploadChunkCompleteData event is getting dispatched before the file._chunk++ is being called in File.as. As a result, if the timing is just right on the browser, the same chunk gets uploaded twice and one gets skipped, as the javascript called uploadNextChunk before file.chunk has been incremented.

Is there a problem with calling file._chunk++ before dispatchEvent(uploadChunkEvt)?

there's lots of code duplication

... that overlaps with functionality part of jQuery

  1. trigger
  2. getSize
  3. each
  4. extend

and code that should better be rewritten using jQuery constructs that take care of cross browser compatibiltiy.

  1. creating an element should be done via $("
    ")
  2. instead of extend.style ... use .css{(...)}
  3. instead of setAttributes ... better use .attr({...}).

example:

$("

")
.attr({
'id': 'some id',
'class': 'some class'
}).
.css({
'position': 'absolute',
'width': '100px',
...
})
.apendTo(container);

  1. use $("#"+uploader.id) instead of document.getElementById(....) for browser cross compatibility.

HTML4 permission denied exception

Hi,
PlUpload works great except HTML4 upload which always throws Permission denied exception. I tried that in every browser and on Windows and Linux.
The problem is in plupload.html4.js when trying to access iframe in try catch block on line 110 which throws error with this message: Permission denied for http://galerie.cz to get property Window.document from http://pedro.upload.local.galerie.cz.
I have javascript files on different domain (sh.local.galerie.cz) than the uploading site (upload.local.galerie.cz) but even if I move all js files to the same domain (upload.local.galerie.cz), I have the same error.

Any ideas?

tmp file uploads to upload_tmp_dir / plupload no matter what.

I'm noticing that even if I change the $targetDir var in the upload.php script, tmp files STILL go to my default tmp dir + plupload.

I'm not able to get a handle on the files in the tmp dir to move them to a different location with move_uploaded_file() or rename()

Widget css

Hey People, just ran into an issue which is fringe case but might be a problem for newbies. The problem is with the positioning the following to divs

.plupload_html5
.plupload_flash

They are absolutely positioned and are appended to the body of the page. This can cause positioning issues because I am already using a Dialog window. So my suggestion would be to to inject them next to the 'Add files' button. Also I am setting up the Widget on page load, but the Dom that they are in is invisible. Using jQuery to work out where to position elements when they are not visible is almost certain to fail? So if you can get away with using css to position them it would be heaps better.

My work around for this is to not instantiate the Widget until it is actually visible on the screen
Cheers
Jake

Change in jquery.plupload.single.js

"uploader.bind('PreInit', function() {" on row 45 in src/javascript/jquery.plupload.single.js:
it does not bind

I have change to "uploader.bind('Init', function() {"
now it runs better

Cancel upload

Hi, from what I can tell, there is currently no way to cancel the upload of individual files or the entire queue. Are there technical reasons for this, or was something like this missed? I believe flash allows the canceling of an upload, but I'm not sure about the other plugins.

plupload is not working with flash settings

I have integrated plupload script and it is working with gears support but if gears are not installed it take flash as another run-time.For flash My script is not working and it's ajax request url:upload.php is calling 4 times by default.
If I am uploading 1 images it is creating 1/2 thumb and 3 more default entries in database.

Can anyone suggest?

Chrome HTML5 Resizing on Linux

Not sure if HTML5 resizing works on other builds of Chrome, but on Linux it won't resize the image. It passes it through at original size. Obviously problematic if your server does not have a limit on upload size and all of a sudden you're getting full size images instead of expected resized images.

I know a developer should always test...But maybe this can be fixed (I know we're at the mercy of Chrome's support for HTML5) and if it can't be fixed, maybe at least the browser can be detected and then plupload can prevent the file from being attached if it's too large or just disable it altogether. Meaning yes that would prevent users from uploading with Chrome if there were no fallbacks (again may be specific to only Linux builds) but at least a less careful developer wouldn't have to worry about that issue because if it IS only related to Linux builds, odds are not everyone is going to have Linux Chrome to test with. Some people are probably just dropping in plupload and walking away - or if they are testing, probably a good handful of people are only testing just with Windows and OS X.

Shim over button with hover effects

Our products use a standard skin that requires that button objects have a hover CSS class that is different from the normal state. When I use the plupload component, it applies the flash/silverlight over the button. This works well for uploading files, and I've been very pleased with the component. Is there a way, however, to bubble the mouseover/mouseout events to the control behind the component so that the hover states will still function properly?

Thanks.

dynamic filters

You should be able to set the filters dynamically so that you can use the same instance of plupload to upload with different sets of filters.

multipart is not working in IE6?

in the config, I already added multipart : true,
It works fine for all the latest browser.

however, it seems not working in IE6?
The User Agent:
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)"
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; (R1 1.5); .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)"

and I got the exception:
org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded
at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.(FileUploadBase.java:885)

Flash uploader is not working

I am trying to integrate pluploder on my site. It is working great with Google gear but it is not working with flash. It stops uploading after 25% every time. Can you please send me new swf file?

Thanks,
Manish

Adding files to queue while uploading

I would like to be able to add files to the queue while others are uploading, but there are some errors with the flash component's uploadChunk function popping up when I attempt to do so.

This may be exacerbated due to the fact that on QueueChanged I call uploader.start() if the status of the component is STOPPED.

File extensions check is case sensitive.

Uploading a JPG or Jpg reports as incorrect file extension when filter contains lower case extension "jpg".

Should either be an insensitive comparison or have a toggle to allow case insensitive comparison. Could an be OS dependant issue?

Support for server side response

If possible I would like to see some support for returning a server side response, perhaps in JSON format, with the FileUploaded event, in a similar way that the response text is returned with the ChunkUploaded event.

Not working when included dynamically

Hello,

I'm trying to include the HTML5 uploader dynamically in my page.
So I do the following with jQuery :

jQuery('#main').append(jQuery('<div id="uploader"></div>'));

Where #main is the div in which I want to include the uploader.

When included like that, the box displays itself successfully. But I can't click on the "Add files" link. It leads to # and reloads the page when I click on it.

If I add the uploader div (but that's something I'd like to avoid to do) in my page statically, it works find and I can browse the files.

Flash uploader very slow

Putting the flash uploader first creates serious speed issues, at least on all browsers on top of OSX.

I load the examples/custom.html page (after modifying the load order to load flash first) and it says 'no library found' then 45-50 seconds later the uploader appears. I have tried this on 3 different machines and every major supported browser for mac, using the latest flash player from adobe? Is this by design or something I'm messing up?

Unexpected event order

Using pluploadQueue with multipart set to true (not sure if this is a consistent problem without these settings but I suspect so).

If I bind to the UploadFile and FileUploaded events, I get the following callback sequence upon adding and uploading two files:

UploadFile (file 1)
UploadFile (file 2)
FileUploaded (file 1)

This makes it impossible to adjust or cancel uploads based on parsing the server response from the first upload.

Specifically, I am trying to alter the multipart_params setting based on the response of the first upload so that the subsequent upload carries those new params. However since FileUploaded for the first file is only raised AFTER the second file upload has already begun, this is not possible.

This is at least the case with the Silverlight runtime (have not tested others).

Is this a bug or intended behavior? Seems like a bug to me - the first upload should complete (including all events/callbacks) before the next begins.

Not Working with .NET Upload Handler

Hi,

I'm trying to use this uploader on a Asp.NET project. I had a HttpHandler that worked with SWFUploader as well as Silverlight, however it wasn't unified and would like to try using Pluploader.

It seems context.Request.Files.Count is always zero or context.Request.InputStream.Length taking while to response, context.Request.QueryString.Count seems empty.

Any help would be appreciated.

Thanks,

Aspect ratio

There is no way to set acpect ration for image scaling.

Drag&Drop

If I use gears and drag & drop files, I can add all files. They are filtered with the uploader files.
For example if uploader is inited with filter only for images I can add with drag&drop and other files.

Define the vars names

It seems we currently can't define the vars names. They must be "name" and "chunk".

Being able to change them to something else would be something quite interesting for existing applications wishing to migrate to plupload :)

Uploading errors are not handled

All runtimes are not handling IO errors during upload process. I'm trying to fix this now and will post patch, when it will be done.

Flash throws error when using debug builds

Steps to reproduce:

1: open the plupload demo page: http://www.plupload.com/example_queuewidget.php
2: select some images and add them to queue
3: press the "submit" button.
4: status message changes to Uploaded 0/3 files

The debugger build of Flash prompts with:

TypeError: Error #1006: dispatchEvent is not a function.
at Function/()

After that you are unable to continue using the plupload application.

Browser:

Webkit nightly, latest nightly doesn't matter

Platform: Mac OSX 1.0.6.2

Flash Player: ( According to: http://kb2.adobe.com/cps/155/tn_15507.html )
Version: MAC 10,1,50,416
Debug Player: YES

Flash runtime and emitted events

In Flash runtime, with option "multipart = true", the events emitted and the 'total' progress vars are somewhat confusing and incosistent with other runtimes.

This has been observed with Flash 10, in both Linux and Windows versions of Firefox, and plupload 1.2.1.

For instance, while uploading 3 files in succession, the series of events emitted as shown with Firebug console.log statements for the last file is as follows:

  1. a FileUploaded event

bytesPerSec 1623051
failed 0
loaded 12528323
percent 73
queued 1
size 17370908
uploaded 2

  1. An UploadProgress event

bytesPerSec 1623051
failed 0
loaded 12528323
percent 73
queued 1
size 17370908
uploaded 2

  1. An UploadProgress event

bytesPerSec 1120101
failed 0
loaded 12528323
percent 73
queued 0
size 17370908
uploaded 3

For the first two files there are equivalent values.

The problem is two-fold:

a) The FileUploaded event says that the file was uploaded, yet the 'total' object does not reflect this. Only on the last 'uploadProgress' event can we be sure that everything was actually uploaded properly.

b) The first uploadprogress event is clearly out of order and offers no information. The second uploadprogress has the complete upload total counts, but this is terribly inconsistent with other runtimes and thus makes the autodetection of runtimes in plupload useless with regard to flash.

If you need any more information let me know.

Extra query string parameters break uploads

Plupload (using Flash runtime...not sure of others) adds "name", "chunk", and "chunksize" query string params to the upload url. This breaks S3 uploads. There is no option to prevent this and there ought to be.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.