Bootstrap4 fileinput bug - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Bootstrap4 fileinput bug (/thread-1624.html) |
Bootstrap4 fileinput bug - Rassamaha78 - 04-18-2020 Im use iwbootstrap4 + Bootstrap File Input library for upload files: Code: procedure TFrameProductPicture.IWBS4File1CustomRestEvents0RestEvent( Most JPG files load normally, but some JPG files, as well as ALL PNG files get corrupted after loading (only part of the image is loaded), here is an example of files BEFORE and AFTER uploading to the server. What could be the reason ? IW version: 15.1.19 [attachment=225] [attachment=226] RE: Bootstrap4 fileinput bug - Rassamaha78 - 04-19-2020 I found out that the data of the input file and the file stored on the server differ by one byte at approximately the same address, then the file structure is saved. I have attached examples of comparison of three files downloaded not by the server, on top is the original file, on the bottom is the file after loading. I circled the places of difference in red (one byte is always lost in the saved file). I still have not figured out what is causing this. [attachment=228] [attachment=229] [attachment=230] RE: Bootstrap4 fileinput bug - TPiotr - 04-19-2020 Hi, I have the same problem with IW v15.1.20 I can't upload multiple files. Only a few files are uploaded. But I do this: If I set IWBS4File1 > CustomRestEvents > uploadUrl > ParseFileUpload to False All files will be uploaded, but I have to manually parse files. RE: Bootstrap4 fileinput bug - Rassamaha78 - 04-19-2020 I noticed that in StandAlone Server mode everything works fine, the problem only occurs in HTTPSys mode. RE: Bootstrap4 fileinput bug - Rassamaha78 - 04-20-2020 (04-19-2020, 09:21 PM)TPiotr Wrote: Hi, How you get a PostStream for parsing ? My aRequest: THttpRequest don`t have PostStream parametr. RE: Bootstrap4 fileinput bug - TPiotr - 04-20-2020 Code: procedure TAppUpload.IWBS4File1CustomRestEvents0RestEvent( You get all files when you set IWBS4File1 > CustomRestEvents > uploadUrl > ParseFileUpload to False Stream looks like this: ------WebKitFormBoundaryQm9CpCSSrHXo0r3p Content-Disposition: form-data; name="IWBS4FILE1[]"; filename="TestFile.png" Content-Type: image/png ‰PNG (...) ------WebKitFormBoundaryQm9CpCSSrHXo0r3p Content-Disposition: form-data; name="file_id" 2 ------WebKitFormBoundaryQm9CpCSSrHXo0r3p-- RE: Bootstrap4 fileinput bug - Rassamaha78 - 04-20-2020 I know what the stream looks like, but I don't know how to get it: If I set ParseFileUpload to False, then the aRequest.Files.Count will always be 0. RE: Bootstrap4 fileinput bug - TPiotr - 04-20-2020 I always have aRequest.Files.Count := 1 CustomRestEvents0RestEvent executes every uploaded file. My code from DFM: Code: object IWBS4File1: TIWBS4File RE: Bootstrap4 fileinput bug - Rassamaha78 - 04-20-2020 (04-20-2020, 10:58 AM)TPiotr Wrote: I always have aRequest.Files.Count := 1 Which apptype are you using SA (IWStart) or HTTPSys(IWStartHSys) ? RE: Bootstrap4 fileinput bug - TPiotr - 04-20-2020 I'm using IWStandAloneServer. It's important to add: Code: implementation |