Jump to content

problem multiupload


Didier

Recommended Posts

hello,

I test multiupload.

1-   when you upload 3 files -> ok
then you upload 1 file without closing window -> it detect 3 files (2 are nil). Problem of initialisation i think but it is not important as i can test.

2 - you put a maximum size of a file (x).

you add 4 files. the third has a size>x

the component upload file1 and 2 and then put an error message and stop. Nothing is upload.
so you put the 3 others which size is <x and then ... no windows, nothing seems happen. But in fact, if you wait a moment, files are uploading.

Can you test before uploading, all the size files and then put a mess ?

I must test cancel button but i think it the same.

 

Thank you

 

Didier

 

 

Link to comment
Share on other sites

Hello Didier,

16 minutes ago, Didier said:

1-   when you upload 3 files -> ok
then you upload 1 file without closing window -> it detect 3 files (2 are nil). Problem of initialisation i think but it is not important as i can test.

Yes, it will be fixed.

http://forums.unigui.com/index.php?/topic/12833-file-upload-multiply/&amp;do=findComment&amp;comment=68322

Link to comment
Share on other sites

ok for this.

But what about the 2 point ?

Quote

2 - you put a maximum size of a file (x).

you add 4 files. the third has a size>x

the component upload file1 and 2 and then put an error message and stop. Nothing is upload.
so you put the 3 others which size is <x and then ... no windows, nothing seems happen. But in fact, if you wait a moment, files are uploading.

 

I test version 1508 and have the same problem.

Link to comment
Share on other sites

Hello Didier,

On 8/9/2019 at 2:29 PM, Didier said:

2 - you put a maximum size of a file (x).

you add 4 files. the third has a size>x

the component upload file1 and 2 and then put an error message and stop. Nothing is upload.
so you put the 3 others which size is <x and then ... no windows, nothing seems happen. But in fact, if you wait a moment, files are uploading.

Can you test before uploading, all the size files and then put a mess ?

I must test cancel button but i think it the same.

We will check.

Link to comment
Share on other sites

Hi

I've the version 1.90.0.1508

I take your sample
C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\FileUpload\Upload.dproj

I make just a litte changes

maxAllowedSize : 104857600
Filter : none
MultiFiles : True


I comment all in procedure TMainForm.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream);

I add :
procedure TMainForm.UniFileUpload1MultiCompleted(Sender: TObject;
  Files: TUniFileInfoArray);
begin
   ShowMessage('all is ok');
end;


For the code : nothing else

and then i test like i said before :

you add 4 files. the third has a size>maxAllowedSize

the component upload file1 and 2 and then put an error message and stop. Nothing is upload.
so you put the 3 others which size is <x and then ... no windows, nothing seems happen. But in fact, if you wait a moment, files are uploading.

 

 

Link to comment
Share on other sites

4 minutes ago, Didier said:

the component upload file1 and 2 and then put an error message and stop. Nothing is upload.
so you put the 3 others which size is <x and then ... no windows, nothing seems happen. But in fact, if you wait a moment, files are uploading.

Hi,

I'm sorry that once again clarified.

It seems I was not able to reproduce.

I will check it again.

Link to comment
Share on other sites

Hi Sherzod,

I take your sample :
C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\FileUpload - Multiple
make some changes

Max allowed size is about 30 Mo. Not image files.

Click On the right button : "Upload Button"
Choose 2 files :
first : 20 Mo
second : 30 Mo
important : The 20 Mo file MUST be uploaded before the 30Mo file.

The first upload
The second not with the advert message.
And then all stop.
This is ok.

Now choose 1 file <30 Mo.
The window with progress is not show.
Nothing seems happen but the file is uploading. This is my problem.
And then "OnMultiCompleted" event execute.


But in fact, my customers will upload severals files.
If the file 50 is > 30Mo, all the 49 files wich have been uploaded aren't really because the event "OnMultiCompleted" is not call.
I just want, if it is possible, to have the advert message BEFORE the uploaded files began.

Main.zip

Link to comment
Share on other sites

On 8/26/2019 at 7:33 PM, Didier said:

I just want, if it is possible, to have the advert message BEFORE the uploaded files began.

Can you try this hasty workaround?

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  UniFileUploadButton1.JSInterface.JSCode(#1+
        '.fileInputEl.addBeforeListener("change", function(a, b) {'+
        '  isValid = true;'+
        '  for (i = 0; i < b.files.length; i++) {'+
        '      if (b.files[i].size > '#1'.maxSize) {'+
        '          isValid = false;'+
        '          Ext.MessageBox.show({'+
        '              title: "MaxSize = " + '#1'.maxSize,'+
        '              msg: b.files[i].name + ": " + '#1'.maxSizeError,'+
        '              icon: Ext.MessageBox.ERROR,'+
        '              buttons: Ext.Msg.OK'+
        '          });'+
        '          return false'+
        '      }'+
        '  }'+
        '  return isValid;'+
      '});'
  );
end;

 

Link to comment
Share on other sites

Hi Sherzod,

my bad, it seems to work fine too. My FF cache.

But i've now another problem :

i put the limit to 300Mo.

TimeoutMS : 0

TimeoutSecs : 0

I upload 4 files : 20Mo-20Mo-64Mo-178Mo

On the third i've a timeout error message at 98%.

It seems timout is about 30 sec for all the uploads.

But in fact, uploading files can take several minutes. But all is working fine.

I was thinking the timeout property was for 1 httprequest.

Link to comment
Share on other sites

Hi Didier,

59 minutes ago, Didier said:

On the third i've a timeout error message at 98%.

It seems timout is about 30 sec for all the uploads.

But in fact, uploading files can take several minutes. But all is working fine.

I was thinking the timeout property was for 1 httprequest.

Ok we will check this.

59 minutes ago, Didier said:

TimeoutMS : 0

TimeoutSecs : 0

Maybe at the moment you will set the value manually !?

Link to comment
Share on other sites

  • 3 years later...
On 8/28/2019 at 7:56 PM, Sherzod said:

Can you try this hasty workaround?

procedure TMainForm.UniFormReady(Sender: TObject);
begin
  UniFileUploadButton1.JSInterface.JSCode(#1+
        '.fileInputEl.addBeforeListener("change", function(a, b) {'+
        '  isValid = true;'+
        '  for (i = 0; i < b.files.length; i++) {'+
        '      if (b.files[i].size > '#1'.maxSize) {'+
        '          isValid = false;'+
        '          Ext.MessageBox.show({'+
        '              title: "MaxSize = " + '#1'.maxSize,'+
        '              msg: b.files[i].name + ": " + '#1'.maxSizeError,'+
        '              icon: Ext.MessageBox.ERROR,'+
        '              buttons: Ext.Msg.OK'+
        '          });'+
        '          return false'+
        '      }'+
        '  }'+
        '  return isValid;'+
      '});'
  );
end;

 

how to implement this code on UnimFileUploadButton (mobile)?. on mobile version it doesn't have maxallowsize property

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...