[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deletion if uploaded file


On 3/16/24 12:29, T Lee Davidson wrote:
On 3/16/24 03:40, Safiur Rahman wrote:
Hi

Why is the the file uploaded through webfilebutton is deleted immediately when upload finishes?

In source code of upload module in GB.web.gui there is cancel(sKey) in finish procedure. Is that necessary?


Yes, it is necessary for the Upload module to manage the state of its uploads.

The WebFileButton's Finish event is fired before the Cancel statement. I am certain this is to give you the opportunity to copy or move the uploaded file at WebFileButton.Path to a different location to preserve it.

I have never used this and cannot verify what I stated is true because I am getting a 500 Internal Server Error when testing it.


I don't know why Apache2 was reporting a "malformed header from script" on the error log. But, I was able to test it, and yes, copying the file to a different location in the Finish event works to preserve the uploaded file. Just make sure the web server has write permission at the new location.


--
Lee

--- Gambas User List Netiquette [https://gambaswiki.org/wiki/doc/netiquette] ----
--- Gambas User List Archive [https://lists.gambas-basic.org/archive/user] ----


References:
Deletion if uploaded fileSafiur Rahman <isafiur@xxxxxxxxx>
Re: Deletion if uploaded fileT Lee Davidson <t.lee.davidson@xxxxxxxxx>