Fix #22: Unable to set form's "name" on file upload
This commit is contained in:
@@ -42,6 +42,7 @@ Follow me [ may expect the file to be streamed rather than sent via a form. Defaults to false.
|
||||
4. `itemAlias` - item alias (form name redefenition)
|
||||
|
||||
### Events
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import { FileUploader, ParsedResponseHeaders, FileUploaderOptions } from './file
|
||||
export class FileItem {
|
||||
public file:FileLikeObject;
|
||||
public _file:File;
|
||||
public alias:string = 'file';
|
||||
public alias:string;
|
||||
public url:string = '/';
|
||||
public method:string = 'POST';
|
||||
public method:string;
|
||||
public headers:any = [];
|
||||
public withCredentials:boolean = true;
|
||||
public formData:any = [];
|
||||
@@ -31,8 +31,9 @@ export class FileItem {
|
||||
this.options = options;
|
||||
this.file = new FileLikeObject(some);
|
||||
this._file = some;
|
||||
if (uploader.options && uploader.options.method) {
|
||||
this.method = uploader.options.method;
|
||||
if (uploader.options) {
|
||||
this.method = uploader.options.method || 'POST';
|
||||
this.alias = uploader.options.itemAlias || 'file';
|
||||
}
|
||||
this.url = uploader.options.url;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ export interface FileUploaderOptions {
|
||||
removeAfterUpload?:boolean;
|
||||
url?:string;
|
||||
disableMultipart?:boolean;
|
||||
itemAlias?: string;
|
||||
}
|
||||
|
||||
export class FileUploader {
|
||||
|
||||
Reference in New Issue
Block a user