Upload to disk

I was in doubt when doing this upload and found a small way to save it, I saw some users with doubts, so I'll post here.
UploadController.zip (697 Bytes)
(This is using a bit of example of how to upload)

3 Likes

Thank you very much for sharing your solution!

1 Like

Hi, Is the input file type in the form different from rz-upload? he doesn’t have a “url”? I’m trying to use this my solution there, but it only passes a “dataURL” and not an “IFormFile” as the upload component

Yes, it is different. It should be used when the file is uploaded as part of a form (as Base64 string). Basically it is the equivalent of the file form field that is available in the Form component. It doesn’t replace the existing Upload component but complements it. You should continue using the Upload component if you want to process the IFormFile server-side.

1 Like

The problem is that by base64 is missing the extension of some files, the solution I found was to accept only .zip and .rar
(I’m saving the dataURL in the database, it’s working, but I do not think it’s the best way, so I thought about how to save only the file, same in rz-upload)

But it pass the file when click in “upload”, if i use in a form, i need to call the submit, passing the name of the archive (i know how) and call the function to save it using the controller of the asp.net, but i not know how