Page 1 of 1

Linux script to create weblinks

Posted: Sat Oct 27, 2018 4:55 pm
by eordona
Hi! I am trying to AUTOMATICALLY create weblinks / download URLs on our Linux system via a shell script. I need this to be non-manual / fully automatic. Here is what I am doing:

1. I create a random 32 character weblink filename (using characters a-f and 0-9 to match the current format) in the ~/wftpserver/Data/_WEBLINK directory

2. I populate the new weblink file with just three lines:
$FULLPATH/$FILENAME
-1
-2040421925

3. I then create the download URL in the following format:

https://$OURDOMAIN/main.html?download&weblink=$WEBLINKFILENAME&realfilename=$FILENAME" rel="nofollow

(Where the capitalized $ values are our specific values)

All of the permissions & ownerships match those created manually via the web interface.

However, my my process isn't working. I get a "No webpage was found for the web address" / 404 error on the links that I create.

From what I can tell, my process is doing what the web interface process is doing... or is there something else that needs to be done to get the weblinks to work?

Thank you very much!!

Re: Linux script to create weblinks

Posted: Mon Oct 29, 2018 7:01 pm
by eordona
Any feedback on this? Directionally is what I am trying to do achievable?

Re: Linux script to create weblinks

Posted: Fri Nov 02, 2018 6:41 pm
by eordona
Is this site still active? Anyone there?

Re: Linux script to create weblinks

Posted: Mon Nov 05, 2018 12:30 pm
by FTP
OK, just make sure the Weblink filename is a 32-byte length string.

Re: Linux script to create weblinks

Posted: Mon Nov 05, 2018 3:00 pm
by eordona
OK, thank you I will double check that.

Re: Linux script to create weblinks

Posted: Mon Nov 05, 2018 8:48 pm
by eordona
OK I figured it out. One has to build the weblink file using CR/LF (carriage return / line feed) in the Windows style, not just CR in the Unix style. I did this in my script by using echo -e and \r and \n:

echo -e "$FULLPATH/$FILENAME\r\n-1\r\n-2040421925" > ~/wftpserver/Data/_WEBLINK/$WEBLINK

Thanks again.

Re: Linux script to create weblinks

Posted: Tue Mar 03, 2020 8:23 pm
by eordona
It looks like maybe you have changed things since v.6.1.3 -- (Maybe in 6.2.2: Added a feature - Added Weblink Manager for managing the download links and upload links.)?? My initial testing of 6.2.5 shows that my process (as outlined above) no longer works... can you please tell me how I can manage this? I used to be able to insert the valid file into the _WEBLINK directory, but now that seems to no longer work. The error I get in my browser for my URLs is: The weblink url does not exist. Help please!

Re: Linux script to create weblinks

Posted: Wed Mar 04, 2020 10:28 am
by FTP
Yes, the weblink rule changed, please email us for more information.

Re: Linux script to create weblinks

Posted: Wed Mar 04, 2020 1:07 pm
by eordona
Thanks... I just did (to the support email)!