Multiple File Upload Move Record From UploadCache Into Another Entity

Help!


Am new to OutSystems and I just fell in love with the platform.


I implemented the MutilpleFIleUpload widget component but am having some issues with the usecase.

I want to be able to iterate through the uploaded files for the uploader and delete the records after iterating, in my implementation, it doesn't work on the first submission, but it does work on the second submission.


Also, is it that my SQL DELETE statement won't work due to the fact that it's on DEV environment?

I also noticed the files get deleted automatically after some time.


I really need to understand this component.


Thanks



Hi Wasiu Kareem,

Regarding the deleted files it happens because there is a timer that runs every 15 minutes to delete temporary cached files.

I did not understood clearly what you need to achieve?

Regards,

Marco Arede wrote:

Hi Wasiu Kareem,

Regarding the deleted files it happens because there is a timer that runs every 15 minutes to delete temporary cached files.

I did not understood clearly what you need to achieve?

Regards,

Hello Marco Arede,

I want to implement a functionality where I can do multiple upload for each user, then move each user uploaded files from the UploadCache into another entity.


How can I disable the timer and allow only my DELETE statement to work.


Regards


Hi Wasiu Kareem,

To deactivate your timer, go to the application eSpace (MultipleFileUpload) and click deactivate timer, as ilustrated next:

To implement an upload per user, did you consider to adapt the cache entity, to include an attribute with UserId ?

Regards,

Hello @Marco Arede,


To identify uploader, I took advantage of the SessionId parameter of the MultipleFileUpload component.


In my attachment base entity where am moving each user upload to, it's has an attribute to map the entity record to the attachment base entity.


Usecase;

CreateProduct, 

for each pictures add to productImage entity

   iterate uploadCache, 

      assign appropriate entity attributes to ProductImage preparation

      add CreateProduct.Id to productId attribute in ProductImage preparation

      CreateProductImage 

  exit

delete from UploadCache where SessionId = Session.Username


But for some reason, it's not working as desired.


I discovered if I submit data the first time, CreateProduct will insert new record into Product entity while product images won't be created. If I try adding another product, the first uploaded pictures will still be in attachment list preparation, if I submit, new product record with the product image mapping will be created.


It's weird but I don't know what I might be doing wrong.


Regards.

Wasiu Kareem wrote:

SessionId = Session.Username

Hi Wasiu,

Did you try using the method GetSessionId, in the extension HTTPRequestHandler?

SessionId = GetSessionId();

More info here:

https://success.outsystems.com/Documentation/11/Reference/OutSystems_APIs/HTTPRequestHandler_API

Regards,