Hello all,
is it possible to have a "virtual URL" to download a file from?
The idea is to offer a download-link, which is not really existing, sort of.
A visitor gets to a form, enters some data like a code or his name or anything alike, then he gets pointed to or gets offered a download-link, which ought to be unique for this moment.
This means, a visitor, of course, could save that URL and pass it to someone else, but it wouldn't work there. Something like
www.server.com/YxPpTtGgNnUuEeWw/FILE.ZIPThe other idea is to generate a sessionvariable, like TODAY() & CLOCK(), and passing this as parameter.
And only when the parameter = sessionvariable the download starts.
This would work, but the user still could slip by and type the URL to fetch the ZIP.
Then I found p_web._SendFile( filename, header).
This can be called in a webpage where you need to be logged in, which can be achieved automatically with parameter = sessionvariable. And it works fine, as long as the file that gets sent, is a non-binary file. My ZIP is also handled as non-binary, the screen is spilled over with special characters...
Is p_web._SendFile() the appropriate method at all?
What would be better?
I hope my description was not too clumsy.
PS: p_web._SendFile( filename, header) - if filename is relative, it needs to be relative to the EXE, i.o.w. './web/file.zip'. Just for info if you plan to use it yourself.