javascript uploader

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dvdljns

    javascript uploader

    How do I make this script direct uploads to a folder called incoming.

    <!-- TWO STEPS TO INSTALL UPLOAD FILTER:

    1. Copy the coding into the HEAD of your HTML document
    2. Add the last code into the BODY of your HTML document -->

    <!-- STEP ONE: Paste this code into the HEAD of your HTML document
    -->

    <HEAD>

    <SCRIPT LANGUAGE="JavaS cript">
    <!-- Original: ArjoGod, Shauna Merritt -->
    <!-- Modified By: Ronnie T. Moore, Editor -->

    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->

    <!-- Begin
    extArray = new Array(".gif", ".jpg", ".png");
    function LimitAttach(for m, file) {
    allowSubmit = false;
    if (!file) return;
    while (file.indexOf(" \\") != -1)
    file = file.slice(file .indexOf("\\") + 1);
    ext = file.slice(file .indexOf(".")). toLowerCase();
    for (var i = 0; i < extArray.length ; i++) {
    if (extArray[i] == ext) { allowSubmit = true; break; }
    }
    if (allowSubmit) form.submit();
    else
    alert("Please only upload files that end in types: "
    + (extArray.join( " ")) + "\nPlease select a new "
    + "file to upload and submit again.");
    }
    // End -->
    </script>
    </HEAD>

    <!-- STEP TWO: Copy this code into the BODY of your HTML document -->

    <BODY>

    <center>
    Please upload only images that end in:
    <script>
    document.write( extArray.join(" "));
    </script>
    <p>

    <form method=post name=upform action="/cgi-bin/some-script.cgi"
    enctype="multip art/form-data">
    <input type=file name=uploadfile >
    <p>
    <input type=button name="Submit" value="Submit"
    onclick="LimitA ttach(this.form , this.form.uploa dfile.value)">
    </form>
    </center>

    <p><center>
    <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsourc e.com">The JavaScript
    Source</a></font>
    </center><p>

    <!-- Script Size: 1.55 KB -->
  • Jeff North

    #2
    Re: javascript uploader

    On 6 Nov 2003 21:31:32 -0800, in comp.lang.javas cript
    dvdljns@yahoo.c om (dvdljns) wrote:
    [color=blue]
    >| How do I make this script direct uploads to a folder called incoming.[/color]

    You can't because the script doesn't handle the actual file upload.
    The upload process is handled by the 'some-script.cgi'.

    Do a Google search on File Upload + <language of your choice>

    [snip 2 end]
    ---------------------------------------------------------------
    jnorth@yourpant sbigpond.net.au : Remove your pants to reply
    ---------------------------------------------------------------

    Comment

    • HikksNotAtHome

      #3
      Re: javascript uploader

      In article <965af528.03110 62131.63679268@ posting.google. com>, dvdljns@yahoo.c om
      (dvdljns) writes:
      [color=blue]
      >How do I make this script direct uploads to a folder called incoming.[/color]
      <snip>[color=blue]
      ><form method=post name=upform action="/cgi-bin/some-script.cgi"
      >enctype="multi part/form-data">[/color]

      you edit the some-script.cgi file to put it in the incoming folder. javascript
      has no ability to actually "upload" files. And the script you have is totally
      useless, as far as uploading that file. Simply put a form on your page, set the
      form, then validate it on the server (which you should be doing anyway). The
      only purpose of the script you have *might* be to check the filetype before
      uploading.
      --
      Randy

      Comment

      • dvdljns dvdljns

        #4
        Re: javascript uploader



        Ok thanks! Tell me do you know Where I can get the right stuff to upload
        files.

        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        Working...