Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

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


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
wheezle
Asked:
wheezle
  • 8
  • 4
  • 3
  • +3
1 Solution
 
weeezlCommented:
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
 
Victor_RCommented:
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
 
stebesplaceCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
wheezleAuthor Commented:

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
 
Victor_RCommented:
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
 
wheezleAuthor Commented:
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
 
Victor_RCommented:
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
 
Victor_RCommented:
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
 
Victor_RCommented:
Oh, in case it wasn't clear:

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

Good luck.
0
 
webwomanCommented:
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
 
wheezleAuthor Commented:

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
 
webwomanCommented:
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
 
Victor_RCommented:
>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
 
wheezleAuthor Commented:
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
 
Victor_RCommented:
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
 
SpideyModCommented:
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
 
SpideyModCommented:
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
 
Victor_RCommented:
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
 
SpideyModCommented:
Force Accepted per recommendation above

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Technology Partners: 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!

  • 8
  • 4
  • 3
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now