Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: bencolon/file-uploader
...
head fork: bencolon/file-uploader
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Feb 01, 2012
@TexasAssetProtection TexasAssetProtection Fixed undefined error for file.fileName for firefox 11.0a2 in qq.File…
…UploaderBasic.prototype.

Fixed undefined error for file.fileName for firefox 11.0a2 getName prototype.
Added x-mime-type for xhr works with crome 16 and firefox 10/11.0a2
503611d
Commits on Mar 12, 2012
@bencolon Merge pull request #2 from SQLServerIO/master
FIX: Undefined name on Firefox 11.0a2 ADDED: x-mime-type for xhr data streams.
7e76c26
Showing with 7 additions and 4 deletions.
  1. +7 −4 client/fileuploader.js
View
11 client/fileuploader.js
@@ -427,9 +427,9 @@ qq.FileUploaderBasic.prototype = {
// get input value and remove path to normalize
name = file.value.replace(/.*(\/|\\)/, "");
} else {
- // fix missing properties in Safari
- name = file.fileName != null ? file.fileName : file.name;
- size = file.fileSize != null ? file.fileSize : file.size;
+ // fix missing properties in Safari 4 and firefox 11.0a2
+ name = (file.fileName !== null && file.fileName !== undefined) ? file.fileName : file.name;
+ size = file.fileSize !== null ? file.fileSize : file.size;
}
if (! this._isAllowedExtension(name)){
@@ -1216,7 +1216,8 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
getName: function(id){
var file = this._files[id];
// fix missing name in Safari 4
- return file.fileName != null ? file.fileName : file.name;
+ //NOTE: fixed missing name firefox 11.0a2 file.fileName is actually undefined
+ return (file.fileName !== null && file.fileName !== undefined) ? file.fileName : file.name;
},
getSize: function(id){
var file = this._files[id];
@@ -1266,6 +1267,8 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
xhr.setRequestHeader("Content-Type", "application/octet-stream");
+ //NOTE: return mime type in xhr works on chrome 16.0.9 firefox 11.0a2
+ xhr.setRequestHeader("X-Mime-Type",file.type );
xhr.send(file);
},
_onComplete: function(id, xhr){

No commit comments for this range

Something went wrong with that request. Please try again.