Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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?

    What's my password?
    Create A New User
    [Lady_Aleena]: Would you use a module that is almost 150 characters to type with the use and importing all subroutines?
    [LanX]: use module :all ?
    [Lady_Aleena]: Lax, that would take it down to a little less than 100 characters. The module name is nearly 80 characters long.
    Lady_Aleena has fumble fingers today.
    [Lady_Aleena]: Sorry for the name typo LanX.

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (6)
    As of 2017-05-24 21:53 GMT
    Find Nodes?
      Voting Booth?