File Upload Component Crashes Gateway

Has anyone used the file upload component in perspective and caused the gateway to crash?

I'm testing that out and after I select the image, the gateway then crashes. Any ideas as to why its crashing everytime?

What shows up in your wrapper log (the text file--not the logs in the web interface) ?

1 Like

I haven't been able to recreate this. However, now my perspective session is crashing when uploading a third file.

I am trying to build a screen where a user enters data and uploads pictures. Now I'm trying to insert them into the database (MySQL blob) which is working fine and pulling the images back out into a report is fine.

That said, on the screen I want the data and files (pictures) to be entered and when they hit submit, it sends all the data and pictures to the database. I move the file uploaded to a custom property called pictures which holds the data from the event.file.getBytes() function.

After uploading the 3rd image, my perspective session crashed. This is consistently now crashing when the third image is uploaded.

I want to wait to upload just in case the user selects the wrong picture or wants to take a new one. And all at once on a button push to insert the data and get its ID column (auto incremented) and use that as a foreign key in my images database table.

You still haven't supplied anything from your wrapper log file. We are not mind-readers. :man_shrugging:

1 Like

Hello,

I have the same problem when I want to upload files, for example '.pdf', larger than 2MB, the file upload component crashed gateway.

This is the code I have in the component:

data_b64 = base64.b64encode(event.file.getBytes()).decode('utf-8')
name = event.file.name
extension = name.split('.')[-1] if '.' in name else 'unknown'
size = event.file.size

When I load the file the screen freeze

Does your Gateway contain any logging which might explain what is happening?

Is this code in the onFileReceived Event?

I don't get any errors, after uploading the file it freezes.

Yes, the code is inside that component.

Uploading the file is actually crashing your Gateway? If so, you should reach out to Support instead of these forums. If it's just the Perspective Session which is freezing, there could still be logging present on the Gateway which could provide insight.