04-18-2020, 08:26 PM
Im use iwbootstrap4 + Bootstrap File Input library for upload files:
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
2bd0d041e0ef4632bf8e55d21ebc70a8.png (Size: 252.03 KB / Downloads: 10)
Code:
procedure TFrameProductPicture.IWBS4File1CustomRestEvents0RestEvent(
aApplication: TIWApplication; aRequest: THttpRequest; aReply: THttpReply;
aParams: TStrings);
var
FileUpload: THttpFile;
begin
if aRequest.Files.Count > 0 then
begin
FileUpload := THttpFile( aRequest.Files[ aRequest.Files.Count - 1 ] );
FPictureFile := IWServerController.ContentPath +
UPLOAD_FOLDER + '\' +
TPath.GetGUIDFileName.ToLower +
ExtractFileExt( FileUpload.FileName );
FileUpload.SaveToFile( FPictureFile );
end;
aReply.WriteString('{"id": "1"}');
end;
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
2bd0d041e0ef4632bf8e55d21ebc70a8.png (Size: 252.03 KB / Downloads: 10)