forked from MapComplete/MapComplete
Add rudimentary check for filesize, fix #497
This commit is contained in:
parent
6a821acd14
commit
adf02af5fe
4 changed files with 3648 additions and 3629 deletions
|
@ -7,12 +7,14 @@ export default class ImgurUploader {
|
|||
public readonly failed: UIEventSource<string[]> = new UIEventSource<string[]>([]);
|
||||
public readonly success: UIEventSource<string[]> = new UIEventSource<string[]>([]);
|
||||
private readonly _handleSuccessUrl: (string) => void;
|
||||
|
||||
public maxFileSizeInMegabytes = 10;
|
||||
|
||||
constructor(handleSuccessUrl: (string) => void) {
|
||||
this._handleSuccessUrl = handleSuccessUrl;
|
||||
}
|
||||
|
||||
public uploadMany(title: string, description: string, files: FileList) {
|
||||
public uploadMany(title: string, description: string, files: FileList): void {
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
this.queue.data.push(files.item(i).name)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue