Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hey Monks!!!

I am trying to implement a script which upload a fixed gif and html files from a fixed local directory into a fixed folder of our
website, which will be happened everyday, so that i am trying to do some automated process so that I don't have to use
FTP software to upload that file everyday. I have tried the following methode, its uploading the file from local machine to
the web directory through a form, but the problem is it can't read the file size, so its copying 0 bite size file. (but if chose
the file from this Form and say upload its working fine, but if I supply the local directiry path its not working) the code as below
my $file_query1 = 'D:\work for people\k****ij\oil1.shtml'; sub Upload { my($query, $upload_dir) = @_; my($file_query, $file_name, $size, $buff, $time, $bytes_count); $size = $bytes_count =0; $_ = $file_query1; s/\w://; s/([^\/\]+)$//; $_ = $1; s/\.\.+//g; s/\s+//g; $file_name = $_; open(FILE,">$upload_dir/$file_name") || &Error("Error opening file $fi +le_name for writing, error $!", 1); binmode FILE; $time=time(); while ($bytes_count = read($file_query,$buff,2096)) { $size += $bytes_count; print FILE $buff; } close(FILE); print "completed<br><br>"; }

In the code this following portion is not working:
---------------------------------------------------------------------- +--------------- open(FILE,">$upload_dir/$file_name") || &Error("Error opening file $fi +le_name for writing, error $!", 1); binmode FILE; $time=time(); while ($bytes_count = read($file_query,$buff,2096)) { $size += $bytes_count; print FILE $buff; } close(FILE);
I simply want to use a CGI or perl script to FTP or transfer some perticular file with from a fixed local folder to a fixed
webfolder, but without usiing manual FTP client software.
can anyone help me with this perticular matter? if you need any more info please let me know. if you think is there any
other way please let me know..

2006-10-08 Unapproved by planetscape once evidence of habitual plagiarism uncovered; Keep: 3, Edit: 10, Reap: 16


In reply to How to upload file without using FTP? by madtoperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (6)
    As of 2014-09-02 00:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (18 votes), past polls