Jump to content

file upload multiply


SayeyeZohor

Recommended Posts

18 minutes ago, Sherzod said:

Hi,

If I understand you correctly, on MultiCompleted event.

High(Files)+1 

procedure TUniOpinionRequestFrm.UniFileUpload1MultiCompleted(Sender: TObject;
  Files: TUniFileInfoArray);
var
  I: Integer;
begin
  for I := 0 to High(Files)+1  do

Do you mean?

Link to comment
Share on other sites

55 minutes ago, Sherzod said:

Please explain 

I want to get the number of uploaded files and rename the file and store it in a folder on the server and save it in the database.


 

    DestFolder:=UniServerModule.StartPath+'UploadFolder\';
    DestName:=DestFolder+ExtractFileName(UniFileUpload1.FileName);
    UniLabel4.Caption:='File Name: '+UniFileUpload1.FileName;
    CopyFile(PChar(AStream.FileName), PChar(DestName), False);

@Sherzod please help me ...

Link to comment
Share on other sites

  • Administrators
for I := Low(Files) to High(Files) do
begin
// your code here
end;
  TUniFileInfoArray = array of TUniFileInfoClass;

  TUniFileInfoClass = class
  public
    property Success: Boolean read FSuccess write SetSuccess;
    property CacheFile: string read FCacheFile write SetCacheFile;
    property FileName: TFileName read FFileName write SetFileName;
    property Stream: TFileStream read GetStream write SetStream;
  end;

 

Link to comment
Share on other sites

3 hours ago, Farshad Mohajeri said:

for I := Low(Files) to High(Files) do
begin
// your code here
end;

  TUniFileInfoArray = array of TUniFileInfoClass;

  TUniFileInfoClass = class
  public
    property Success: Boolean read FSuccess write SetSuccess;
    property CacheFile: string read FCacheFile write SetCacheFile;
    property FileName: TFileName read FFileName write SetFileName;
    property Stream: TFileStream read GetStream write SetStream;
  end;

 

tnx
but new bug
 

I upload a file the first time and it's not a problem, but the problem starts when I upload two or more files, and next time I want to upload fewer files, this time high(files) has the previous value in memory and gives access voliation

 

@Sherzod

@Farshad Mohajeri

Link to comment
Share on other sites

2 hours ago, SayeyeZohor said:

I upload a file the first time and it's not a problem, but the problem starts when I upload two or more files, and next time I want to upload fewer files, this time high(files) has the previous value in memory and gives access voliation

I opened a ticket in the support portal.

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...