Page 1 of 1

Weblink ID in server variable

Posted: Mon Jun 17, 2019 12:59 pm
by JohnRambo
Hi,

I'm currently trying to identify weblink ID use to download the file from weblink.

I can identify that this is a weblink using %Name however I don't have the link unique identifier.

I'm generating several weblink for the same file in WEBLINK folder so on HTTP event OnFileDownloaded I would like a way to catch from which link download effectively happened.

Thanks

Re: Weblink ID in server variable

Posted: Tue Jun 18, 2019 5:47 am
by FTP
OK, you can create a weblink automatically using Lua script in the event "OnFileUploaded -> Lua Script":

Code: Select all

local filepath = string.gsub("%PathName", "\\","/")
local filename = "%FileName"
local weblink = md5(filepath..c_GetGlobalOptionStr(GOPTION_START_TIME_STR))
local fp = assert(io.open(c_GetAppPath().."/Data/_WEBLINK/"..weblink, "wb"))
fp:write(filepath.."\r\n-1\r\n-1")
fp:close()
And the weblink filename (or file path) is also defined in the above code.

Re: Weblink ID in server variable

Posted: Tue Jun 18, 2019 8:24 am
by JohnRambo
Hi

Thanks for providing the step for doing it on upload.
But I'm already doing this with my _WEBLINK folder mapped into a network shared folder.

My use case is that I need to send the same file to several customer.
And I want to identify who as downloaded it and when.

To do so I plan to use several weblink for the same file and send each to different customer.

As of now i'm just missing the way to identify which link trigger the event OnFileDownloaded.

Now with "%Name" i got the following "[WEBLINK]"
What could be of interest here is to get link ID with "%UserEmail",

Re: Weblink ID in server variable

Posted: Wed Jun 19, 2019 1:03 am
by FTP
OK, Wing FTP Server does not support such requirement, there is no Weblink ID variable, maybe you can get the client IP address via the variable "%IP".

Re: Weblink ID in server variable

Posted: Wed Jun 19, 2019 8:56 am
by JohnRambo
Hi,

I manage to use IP with some of my customer who have fixed IP, but some haven't or didn't want to share.
This partially solve my issue.

Is this possible to add such improvement / Feature for next release ?
Or to get a patch for the current one ?
Event manager is a really cool Feature and totally allow to identify the trigger when it's FTP/SSH event type.
But not when it comes to HTTP event where only the ID could do so.

Thanks,

Re: Weblink ID in server variable

Posted: Mon Jun 24, 2019 8:59 am
by JohnRambo
Hi

Do you have any update on feasibility of such request ?

Regards

Re: Weblink ID in server variable

Posted: Tue Jun 25, 2019 5:35 am
by FTP
Sorry, there is no plan to add such feature, because WingFTP doesn't support multiple weblinks for the same file.
And the possible method for you is, create different subfolder for different customer, and then copy the file into each folder and generate weblink, the recent version of WingFTP already supports copy function in the web client.

Re: Weblink ID in server variable

Posted: Tue Jun 25, 2019 2:41 pm
by JohnRambo
Hi,

Thanks for your answer.
Still hope to see an addition of the multiple weblink feature for the future.

Regards

Re: Weblink ID in server variable

Posted: Tue May 26, 2020 3:40 pm
by JohnRambo
Thanks for adding the variable in these release :

Wing FTP Server v6.2.9Released: 3/Apr/2020
• Supported HTTP welcome message, you can define the message under "Domain > Settings > General Settings > Miscellaneous".
• Fixed a bug - The server logs might be wrong for the SFTP "SSH_FXP_ATTRS" response.
• Improvement - Added a variable "%WebLink" for getting the ID of Weblink or Upload link


I really appreciate it.