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!!
Linux script to create weblinks
-
- Posts: 55
- Joined: Fri Aug 24, 2012 5:42 pm
Re: Linux script to create weblinks
Any feedback on this? Directionally is what I am trying to do achievable?
-
- Posts: 55
- Joined: Fri Aug 24, 2012 5:42 pm
Re: Linux script to create weblinks
Is this site still active? Anyone there?
-
- Site Admin
- Posts: 2080
- Joined: Tue Sep 29, 2009 6:09 am
Re: Linux script to create weblinks
OK, just make sure the Weblink filename is a 32-byte length string.
-
- Posts: 55
- Joined: Fri Aug 24, 2012 5:42 pm
Re: Linux script to create weblinks
OK, thank you I will double check that.
-
- Posts: 55
- Joined: Fri Aug 24, 2012 5:42 pm
Re: Linux script to create weblinks
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.
echo -e "$FULLPATH/$FILENAME\r\n-1\r\n-2040421925" > ~/wftpserver/Data/_WEBLINK/$WEBLINK
Thanks again.
-
- Posts: 55
- Joined: Fri Aug 24, 2012 5:42 pm
Re: Linux script to create weblinks
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!
-
- Site Admin
- Posts: 2080
- Joined: Tue Sep 29, 2009 6:09 am
Re: Linux script to create weblinks
Yes, the weblink rule changed, please email us for more information.
-
- Posts: 55
- Joined: Fri Aug 24, 2012 5:42 pm
Re: Linux script to create weblinks
Thanks... I just did (to the support email)!