Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: File opening

  1. #1
    New Coder
    Join Date
    Dec 2007
    Posts
    18
    Thanks
    2
    Thanked 0 Times in 0 Posts

    File opening

    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

  • #2
    Regular Coder
    Join Date
    Oct 2006
    Posts
    181
    Thanks
    1
    Thanked 6 Times in 6 Posts
    hope this helps... this file/form would be placed into the /folder/ directory..

    this is mainly javascript that does this..

    Code:
    <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>
    Quote Originally Posted by Excavator
    write it for firefox then hack it for IE

  • #3
    New Coder
    Join Date
    Dec 2007
    Posts
    18
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Shoot2kill

    Brilliant just brilliant...
    Thank you so much!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •