Use Corvid to shorten a URL

My free Wix webpage contains the file share app. When I add a file (e.g. typically a zip file or a pdf file) to this app, Wix assigns a url (i.e. a link) to the shared file.

When I post a query to any forum (e.g. Math-Stack-Exchange), I may want to imbed a clickable link in the forum posting. When the reader clicks on the link imbedded in this forum posting, their browser will immediately retrieve the file that has been uploaded to my file-share app on my Wix webpage. This means that the reader never has to navigate to my wix webpage.

This strategy works except that the url (i.e. the link) that Wix assigns to the shared file is very long . Given that my website is https://zug987zwang.wixsite.com/mysite, I would like the shared file to be assigned a url that is formatted similar to https://zug987zwang.wixsite.com/mysite/my-shared-file.pdf.

No joy querying Wix support. If I have to, I will use a url shortener via (something like) bitly.com. However, I am hoping for a cleaner solution. As a retired java programmer, I tried to explore the facilities offered by Corvid , but became confused.

Can Corvid help here?

My intuition suggests not, because I would first need to place some type of widget on my (free) webpage and assign a url to that widget. I would want to control the format of the url assigned to the widget, giving it a name like https://zug987zwang.wixsite.com/mysite/my-widget. Then I would alter the properties of the widget, assigning a link to it. The link would correspond to the long link name assigned to the file that I uploaded to the file share app on my webpage. The strategy would then be to imbed the https://zug987zwang.wixsite.com/mysite/my-widget url in the (for example) math-Stack-Exchange forum posting. Then when anyone clicks the imbedded url, they should automatically retrieve the pdf file in their browser.

I was able to solve the problem myself. When editing my free webpage, first I turned on Dev Mode. Then I took the :

[Menus and Pages : add page] option

This allowed me to create a custom url. For example, on my https://zug987zwang.wixsite.com/mysite webpage, adding the page
pdf-khinchin created the following url, which starts as a blank page:

https://zug987zwang.wixsite.com/mysite/pdf-khinchin

Examining the auto-generated code template (below)

$w.onReady(function () {

});

I converted it to:

import wixLocation from ‘wix-location’;
$w.onReady(function () {
[wixLocation.to(“https://wixlabs-file-sharing…[the_long_url]…”)](wixLocation.to(“https://wixlabs-file-sharing…[the_long_url]…”)
}):wink:
[});](wixLocation.to(“https://wixlabs-file-sharing…[the_long_url]…”)
}):wink:

This worked okay, except that the ( blank ) https://zug987zwang.wixsite.com/mysite/pdf-khinchin webpage must load first, before it redirects to the pdf file. This results in a 1-2 second pause after the blank webpage loads, before the pdf file is retrieved.

I decided that it is cleaner (i.e. will be less confusing to others) if I instead employ bitly.com. Therefore, although the above strategy works (i.e. I found a functional substitute for re-direction for my free website) I have scrapped it.

Still pending :
I feel that a better solution would be to add some widget to my free home page, https://zug987zwang.wixsite.com/mysite/ , where I get to assign a url formatted like https://zug987zwang.wixsite.com/mysite/ my-widget to the widget. Then, I could (perhaps) assign Corvid code that was triggered by the url assigned to the widget .

From what I have seen (and I could easily be wrong) the only way to do this on a free wix webpage is by adding a page to the https://zug987zwang.wixsite.com/mysite/ webpage; I have rejected this option (above). If anyone knows a better way, please respond.

A still better approach would be to add Corvid code to my https://zug987zwang.wixsite.com/mysite/ webpage that (in effect) does the following:
1.creates a dummy url such as https://zug987zwang.wixsite.com/mysite/pdf-khinchin that has no webpage associated with it.
2.Uses the wixLocation.to (“https://…”) function to re-direct the dummy url to the pdf file.

If anyone has thoughts on this, please respond.