Results 1 to 5 of 5

Thread: Need some help with "Upload.pl".[Solved]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2004
    Location
    sweden
    Posts
    176

    Need some help with "Upload.pl".[Solved]

    Hello.
    I know nothing about cgi and perl, but i got this uploading script and i need help with two changes if they are possible to make.

    1. How can i make "enter" or "new line" after printing this?
    print ff $in;

    2. It will save all uploaded txtfiles as "SAVE.txt", would like it beter if it was saved as the 5 first letters inside the uploaded txtfile "@inx".


    Code:
    #!/usr/bin/perl
    use CGI;
    $CGI::POST_MAX = 2048;
    print "content-type: text/html\n\n";
    binmode(STDIN);
    @inx = <STDIN>;
    splice(@inx,0,4);
    splice(@inx,$#inx,1);
    $in = join("",@inx);
    $in = substr($in,0,length($in) - 2);;
    
    open (ff,"<SAVE.txt"); 
    @list = <ff>;
    open(ff,">SAVE.txt");
    binmode(ff);
    print ff $in;
    print ff (@list);
    close(ff);
    print "DONE, Uploaded Size: ".length($in)." bytes";
    Many big thanks,
    naitsabes
    Last edited by naitsabes85; Jan 28th, 2005 at 11:18 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width