...

View Full Version : File opening



novabcfc
12-15-2007, 01:56 AM
Hi I want to create a simple (very) form that my clients can retrieve their pdf document when I upload it to my site.

Simply put, a form that would accept their code in a text box and append it to my site url and thus opening the file.

example
client types 12345.pdf hits submit.
Page /mysite.com/folder/12345.pdf will thus open.

I can do the whole site indexing through my cms but that seems such over kill for a simple file request.
Any help would be appriciated I've been on this all (yep) day.

Cheers:D

Shoot2Kill
12-15-2007, 06:53 AM
hope this helps... this file/form would be placed into the /folder/ directory..

this is mainly javascript that does this..



<html>
<head>
<script type="text/javascript">
<!--

window.onload=function() {
df=document.forms[0];
df[0].focus();
df[1].onclick=function() {
if((isNaN(df[0].value))||(df[0].value=='')) {
alert('enter PDF filename');
df.reset();
df[0].focus();
return;
}
location.href=df[0].value+'.pdf';
}
}

//-->
</script>

</head>
<body>

<form action="#">
<div id="container">
<h1>enter PDF name (excl, .pdf)</h1>
<input type="text"/>
<input type="button" value="OK"/>
</div>
</form>

</body>
</html>

novabcfc
12-15-2007, 06:45 PM
Shoot2kill

Brilliant just brilliant...
Thank you so much!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum