Weblink ID in server variable

Please post here if you have problems in using Wing FTP Server.
Post Reply
JohnRambo
Posts: 14
Joined: Mon Jun 17, 2019 12:52 pm

Weblink ID in server variable

Post 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
FTP
Site Admin
Posts: 1917
Joined: Tue Sep 29, 2009 6:09 am

Re: Weblink ID in server variable

Post 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.
JohnRambo
Posts: 14
Joined: Mon Jun 17, 2019 12:52 pm

Re: Weblink ID in server variable

Post 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",
FTP
Site Admin
Posts: 1917
Joined: Tue Sep 29, 2009 6:09 am

Re: Weblink ID in server variable

Post 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".
JohnRambo
Posts: 14
Joined: Mon Jun 17, 2019 12:52 pm

Re: Weblink ID in server variable

Post 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,
JohnRambo
Posts: 14
Joined: Mon Jun 17, 2019 12:52 pm

Re: Weblink ID in server variable

Post by JohnRambo »

Hi

Do you have any update on feasibility of such request ?

Regards
FTP
Site Admin
Posts: 1917
Joined: Tue Sep 29, 2009 6:09 am

Re: Weblink ID in server variable

Post 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.
JohnRambo
Posts: 14
Joined: Mon Jun 17, 2019 12:52 pm

Re: Weblink ID in server variable

Post by JohnRambo »

Hi,

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

Regards
JohnRambo
Posts: 14
Joined: Mon Jun 17, 2019 12:52 pm

Re: Weblink ID in server variable

Post 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.
Post Reply