?
Solved

linking to "filena*.pdf" -- is it possible?

Posted on 2003-02-27
19
Medium Priority
?
210 Views
Last Modified: 2013-11-18

SCENARIO:
There will be many pdf files available to users, linked through an online HTML file.  Every time one of these pdf files is updated, it changes the name of the file, but only the last few characters.

EXAMPLE:
A file is available called "1-359-171202.pdf"
Updated recently this would become "1-359-090203.pdf"

(Notice the date in the filename)

PROBLEM:
We don't want to keep changing the link to this pdf file in the HTML coding.  Can we link to the first few characters of the pdf file?

IN OTHER WORDS:
Have link to "1-359-171202.pdf"
Want link to "1-359-*.pdf"


Looking for quick reply, please -- easy points!  Thank you for any info.

0
Comment
Question by:wheezle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 4
  • 3
  • +3
19 Comments
 
LVL 2

Expert Comment

by:weeezl
ID: 8035612
Unfortunately, HTML is HTML. This is why people use databases and scripting languages because it eases the process of these types of updates.

If you don't have access to these tools, I would recommend doing something like this.

Change the HTML to refer to a file called 1-359-current.pdf or something like that. When you create a new file, create a copy, rename it to 1-359-current.pdf, and then upload that one to replace the old file. You will still have a local copy of all changed files, but will only make available the most recent one online. That way you won't have to change the HTML.

Don't know if that works but it's an idea.
0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8035814
wheezle,

I have an idea, but your server must support Server Side Includes.

>Have link to "1-359-171202.pdf"
>Want link to "1-359-*.pdf"

You can use a last modified script as follows:

<a href="1-359-
<!--#include virtual="cgi-bin/lastmodified.cgi" -->
.pdf">My PDF File</a>

You just have to get a last modified script (free available in my plces, sometimes even already working on your server) and modify it to output the date in the format you need.

Victor
0
 

Expert Comment

by:stebesplace
ID: 8035847
Date namming conventions are fine when using them for stand alone documents that do not get updated. If you want to name a document for consistent updates, then you must use a convnetion that is universal. As menioned above, you should try to keep all files you directly work with, off the server, and on a local drive, then the files that actually get used online, would be named blah_current.pdf so that when the file is uploaded, no new naming has to take place. Make sure that as mentioned as well above you do not overload yourself with local files and make sure the files are all contained with their respective names on your local computer.

Another alternative is to use some sort of scirpting that would enable the file to be automatically uploaded when you update the file. That is a much more complex scenario and unless you have some time to figure it out, would advise against it.

Hope this assists you.

-Steve
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:wheezle
ID: 8035873

Thanks, that idea actually came up already, but we decided that it would be better to have the single files rather than trying to remembering to update them after updating the original.

We'll increase the points even more if you can post a script that will do what we want.  There must be a way of doing it somehow -- it doesn't seem very tricky.

We just want it to work, we don't really care what language it uses!  :)

0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8035990
I need to know your level of technical ability. If I spend the time to design a script for you, will you know how to use it? Do you know what CHMOD means? Do you know if your server supports Server Side Includes (SSI)?

I don't care about points...they aren't worth anything. I'm trying to help, and I don't want to waste my time or yours.
0
 

Author Comment

by:wheezle
ID: 8036090
Victor R,

My experience using scripts is rather limited.  Javascript is about the extent of my non-HTML coding, but I know that it's different from what you're talking about -- I could probably follow along if you're patient.  I can certainly follow directions though.  :)

Part of the website has password protection -- but it's located at a different url because the original one doesn't support SSI.  (Something to do with the company's policy.)  So I could potentially post this script on the other site and get it to work there for us on ours.

Sorry, long story short: yes, SSI probably is supported.

Thanks for your help.
0
 
LVL 1

Accepted Solution

by:
Victor_R earned 1400 total points
ID: 8036152
Ok give me some time.

In the mean time, you may be able to figure it out on your own. There is an excellent page here: http://www.anu.edu.au/web/authors/resources/ssisum.php

Look for "flastmod". You will have to use other commands to get the output of flastmod to look like the part of the PDF file names that is missing.

Then you will put something like this in your HTML code:

<a href="1-359-
<!--flastmod file="file.pdf" -->
.pdf">My PDF File</a>
0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8036512
wheezle,

try this in your HTML page:

<!--#config timefmt="%d%m%y"-->
<a href="1-359-
<!--#flastmod virtual="../file/file1.html"-->
.pdf">My PDF File</a>

And tell me what the output is please. Is this page available online where I can see it?
0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8036518
Oh, in case it wasn't clear:

Replace ../file/file1.html with the name and path to your PDF file.

Good luck.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 8037068
If you have ASP support, and you put all the files in ONE folder, it's really not that hard to do server side.

You use FSO to get the folder list, and cycle through the files there. If you want to filter them, you can check the dates and list only those less than x days old, and if you increment a counter for each file that matches you can then display a 'nothing found' notice if the counter stays at 0. You can set a link to the file, show the file name, the date on the file and the file size.

You could even have a link to a page that gave a list of ALL the files, regardless of date.

No worrying about permissions, filenames, or overwriting old files.
0
 

Author Comment

by:wheezle
ID: 8054415

Um, okay, I want to try this flastmod thing, it sounds like what I need, but this is an example of one of the links:

http://142.204.21.51/pre_document.asp?Key1=345679OESUTR87XDR57JGSEI83587KIRK87TI7FT&Key2=CNCPCMCMCRCPDLCOCQCODLJFLO

It's ugly, I know, but apparently we have to use this.

So, the files are all located at this 142.204.21.51 place under a folder there called "Subject Outlines" but I don't know how to change the links to nicer looking ones.

We don't really want people browsing through the old files, and we can't move the old files to another folder, nor can we play around with the existing file names.  I'm assuming the only leeway there is is with the links.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 8054717
If you don't want the long links, you could just put numbers (use a counter, put in the text for the link) or the dates (again, just use that as the text for the link).

While you certainly need to use the filename to create the link, it doesn't have to BE the link.
0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8057194
>http://142.204.21.51/pre_document.asp?Key1=345679OESUTR87XDR57JGSEI83587KIRK87TI7FT&Key2=CNCPCMCMCRCPDLCOCQCODLJFLO

I don't understand. In your origintal question, you said they looked like this:

>A file is available called "1-359-171202.pdf"
>Updated recently this would become "1-359-090203.pdf"

Which part of the huge link is the date?? You've totally changed the question here...
0
 

Author Comment

by:wheezle
ID: 8069585
I know, I know, it is confusing...  Sorry, it goes something like this:

The file is called, say, "1-359-171202.pdf" but to be able to link to it past all the password stuff (I'm assuming) you have to put in that awfully long complicated link.  We couldn't link directly to the filename for some reason.

So there's the added problem of not knowing why it won't link to the filename.

I think Key1 and Key2 have something to do with the 1-359- bit and the date bit at the end, but I'm not entirely sure.
0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8071619
There is absolutely nothing I can do to help you with that.

I would have to know how you are encrypting the filename; you should be able to find that out. Even if you do, the method I was suggesting works by using the date the file was modified as part of the file name. I can't simply create that string of encrypted characters. You would need some more complicated language for that, such as Perl, that I don't know. I wish you had said something about this originally.

As it is, I'm at a loss.
0
 

Expert Comment

by:SpideyMod
ID: 8131486
wheezle,
It seems like you have an answer to this question.  I will give you 72 hours to accept an answer or explain why you have not accepted an answer.

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Expert Comment

by:SpideyMod
ID: 8148833
Experts, I need your advice on closing this question out.  Let me know which expert(s) should receive points on this.  Thanks.

SpideyMod
Community Support Moderator @Experts Exchange
0
 
LVL 1

Expert Comment

by:Victor_R
ID: 8151552
Well, personally I vote me. IMO, I had provided a solution to the question as originally asked. Only when the question was changed on 03/02/2003 05:44PM PST, I could no longer solve it.
0
 

Expert Comment

by:SpideyMod
ID: 8167317
Force Accepted per recommendation above

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article discusses four methods for overlaying images in a container on a web page
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question