On Sun, 14 Jul 2013, silvioprog wrote:
Hello, Please see: http://bugs.freepascal.org/view.php?id=24746
There are several things VERY wrong with your test program. First: VFile.Read(VBuf, VBufLen); // reading only the first 1024 bytes ... Overrides the VBUf address. It must be VFile.Read(VBuf[0], VBufLen); // reading only the first 1024 bytes ... Secondly, VFile.Free; // free stream allowing to delete uploaded file, but, it causes Frees the stream, but does not set the Stream property of TUploadedFile to nil. When TUploadedFile is freed, it frees again the memory stream, causing an access violation. I do not understand how your program could ever function. I got access violations all over the place trying to run it. Anyway, after fixing the 2 above issues it ran smootly. Now, I suspect that the DeleteTempUploadedFiles does not work because Windows has the files locked when you attempt to delete them, so I changed TUploadedFile.DeleteTempUploadedFile so it first frees the stream if there is one. (cannot test that under Linux, where the demo runs fine) Michael. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal