Skip to content

Commit

Permalink
Fixed some progress issues on WebKit and added a force option for url…
Browse files Browse the repository at this point in the history
…stream in the Flash runtime.
  • Loading branch information
spocke committed Sep 8, 2010
1 parent 94d39f1 commit 89c59b2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version 1.2.x (2010-xx-xx)
Version 1.2.4 (2010-09-08)
Added new BeforeUpload event to make it easier to override settings before a file is uploaded.
Added new automatic usage of FileReference in Flash if it's possible. Contributed by Marcel Jackwerth.
Added new chunking support for Chrome 5 and Firefox 3.6 using the HTML 5 runtime.
Expand Down
3 changes: 2 additions & 1 deletion src/flash/plupload/src/com/plupload/File.as
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ package com.plupload {
var resize:Boolean = (settings["width"] || settings["height"]);
var chunking:Boolean = (settings["chunk_size"] > 0);

return (!(/\.(jpeg|jpg|png)$/i.test(this._fileName)) || !resize) && multipart && !chunking;
// Check if it's not an image, chunking is disabled, multipart enabled and the ref_upload setting isn't forced
return (!(/\.(jpeg|jpg|png)$/i.test(this._fileName)) || !resize) && multipart && !chunking && !settings.urlstream_upload;
}

public function simpleUpload(url:String, settings:Object):void {
Expand Down
3 changes: 2 additions & 1 deletion src/javascript/plupload.flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@
multipart_params : settings.multipart_params,
file_data_name : settings.file_data_name,
format : /\.(jpg|jpeg)$/i.test(file.name) ? 'jpg' : 'png',
headers : settings.headers
headers : settings.headers,
urlstream_upload : settings.urlstream_upload
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/javascript/plupload.html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
// Do we have upload progress support
if (upload) {
upload.onprogress = function(e) {
file.loaded = loaded + e.loaded - multipartDeltaSize;
file.loaded = Math.min(file.size, loaded + e.loaded - multipartDeltaSize); // Loaded can be larger than file size due to multipart encoding
up.trigger('UploadProgress', file);
};
}
Expand Down

0 comments on commit 89c59b2

Please sign in to comment.