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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Need help with image upload script..

    Hi all you experts out there..
    I´m not that good at this scripting stuff, but i try my best anyway..
    I´m trying to add a image uploader to my site, but it will not work..
    I get this message when i try to upload..:

    Method Not Allowed
    The requested method POST is not allowed for the URL /gallery.htm.


    --------------------------------------------------------------------------------

    Apache/1.3.29 Server at xn--englesd-v1a.com Port 80

    The script html is this..:

    <html>

    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>

    <script type="text/javascript">
    <!--//
    var count = 0;
    function addFile(insertHere,howMany){
    var form = document.forms[0];
    var tbody = document.createElement('tbody');
    var newRow = document.createElement('tr');
    var newCell = document.createElement('td');
    var newInput = document.createElement('input');

    num = howMany;
    newRow.onclick = new Function('addFile(this,num)');
    newInput.onblur = function(){
    if(this.value == '' && this.className.match(/file/i)){
    insertHere.parentNode.removeChild(this.parentNode.parentNode);
    count = count-2;
    }
    }

    if(insertHere.getElementsByTagName('input')[0].value == ''){
    insertHere.getElementsByTagName('input')[0].onchange = function(){
    insertHere.parentNode.insertBefore(newRow,insertHere.nextSibling);
    insertHere.getElementsByTagName('input')[0].className = 'file';
    count++;
    }
    }



    if(count < howMany-1){
    newInput.type = 'file';
    newInput.name = 'file'+count;
    newCell.appendChild(newInput);
    newRow.appendChild(newCell);
    tbody.appendChild(newRow);
    }


    // alert(insertHere.parentNode.firstChild.innerHTML)

    }
    //-->
    </script>
    </head>

    <body>
    <form method="post" action="http://www.xn--englesd-v1a.com/gallery.htm">
    <table>
    <tr onclick="addFile(this,3)"><td>
    <input type="file" name="file" value=""></td></tr>
    </table>
    <input type="submit" value="Submit">
    </form>
    </body>

    </html>

    Can someone please help me..

    Best Regards AngelDK

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think you're going to need a Server side script to get this working like PHP

  • #3
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Hi again.

    Thx for responding.

    Can you tell me more about this PHP server script.

    How do i do. and is it easy to set up
    and what do i need to do, to get it running.

    Best Regards AngelDK
    __________________________________________________
    Damn i must be a dumbass for not knowing these things..!

  • #4
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi again..

    when i have made a upload webpage and have put in a php encrypt password script.. how do i get the picture to show on the page it should upload to

  • #5
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Hi John33

    Thx for the script.
    But there is something missing.
    There is no button, so that visitors can browse for the image they would like to upload.

    Can this be right or is it a mistake. Sorry..
    ________________________________________________________________
    I just wish that i had my head put on the right way to solve all my tasks..

  • #6
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy

    Hi again..

    Forgot to say.. Yes i have frontpage..

    Well John33 i tryed the script you made, by putting the file path in manually and it did open my gallery, but the image never showed up in the gallery.
    How can i get the images that in time can be uploaded to apear on the webpage i want them to show up on..
    ________________________________________________________________
    Some times i wish there was no such thing as a noob..


  •  

    Posting Permissions

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