• My website had links to GPS files users can download for hikes.
    When I converted to WordPress, the links stopped working.

    I tried to upload .GPX and .kmz files. When I use the Add Media uploader, I get a ‘cannot upload files for security reasons’.
    I have been able to FTP the files to my website. When I create a link, it works fine during editing. But on the live page, the link tries to open up a new page instead of downloading the file.
    I have been able to get downloading to work by inserting ‘download=”name of file here” ‘ into the HTML code, but this is tedious at best. If I leave the download=”” empty, the file downloads, but leaves an ‘html’ extension on the file which would make the download useless unless the user manually deletes the extension.
    If I could upload these files, then do a link, or even just do the link and have the file download, this would be much easier than the HTML editing I have to do for each link.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter thehammer610

    (@thehammer610)

    Note that the first two GPX and KMZ links seem to work because I have included the download command. But the next two links, further down on the page do not as the link tries to open a new webpage.

    Thread Starter thehammer610

    (@thehammer610)

    https://orcalcoast.com/index.php/gold-beach-oregon-coast-trail/

    Here is a case of a PDF file that will not download on the live page – it tries to open a new webpage rather than download a file. But it will download the PDF when I check the link in the editor.

    Not sure if I can upload a PDF via the Media uploader.

    lisa

    (@contentiskey)

    I have uploaded many PDF files into the media library for use on a page and a post for visitors to view and print.
    What is the procedure you are using to add a new PDF file into the media library?

    lisa

    (@contentiskey)

    what is the exact link to the pdf file that is created when the file is uploaded into the media library?

    Thread Starter thehammer610

    (@thehammer610)

    Here is the link in the page with the PDF as it appears:

    ../hiking/oregon_coast_trail_map_to_brookings.pdf

    There is not a “index.php” in the link as inserted into the page. The “text” code (which looks like old school HTML) is as follows:

    “Download a [a href=”../hiking/oregon_coast_trail_map_to_brookings.pdf” target=”_blank” rel=”noopener noreferrer”]PDF map of the hike.[/a]”

    Sub greater than and less than for the brackets to get the code.

    In this case, I did not upload the PDF into the Media Library. It is a leftover file from my former HTML website prior to converting to WordPress. It is located in the subdirectory /hiking/ and the file name is exactly as it appears in the link above.

    I have tried putting the link in exactly as ‘aCstudent’ suggested, including the “https://orcalcoast.com”. When I do so, WordPress deletes that portion of the link and substitutes “../” for the beginning of the link – which should be just fine.

    • This reply was modified 6 years, 8 months ago by thehammer610.
    Thread Starter thehammer610

    (@thehammer610)

    • This reply was modified 6 years, 8 months ago by thehammer610.
    Thread Starter thehammer610

    (@thehammer610)

    With a lack of suggestions, I have taken to manually changing the code for every download link to include the ‘download=”[name here]” ‘ code for the kml and gpx files. For example:

    [a href=”/gps/McKinley Mine Trail.kmz” rel=”noopener” download=”McKinley Mine Trail.kmz”]kmz[/a] works just fine (substitute < in for [ and you get the code).

    For the PDF file, I had to use a slightly different code:

    [a href=”https://orcalcoast.com/hiking/rogue_river_walk.pdf&#8221; rel=”noopener” download=”rogueriverwalk.pdf”]download this PDF[/a] For some reason, using the relative location did not work, so I had to use the complete URL. If I used the relative URL of /hiking/rogue_river_walk.pdf, the PDF would download, but when displayed, I got a ‘corrupted’ file response.

    Obviously, this is a pain. There should be some other way to do it.

    Using the Media Uploader would simplify the PDF link and download. But the Media Uploader will not accept the GPS files (kmz and gpx) due to ‘security reasons’.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Create Downloadable Links’ is closed to new replies.