when the file is bigger (>300kb)the file gets copied partially before truncating and returning an error message

I find the same thing when I scp_put (~6Mb file) from Windows to a remote linux server ... but no problem when I scp_put the same file from the same Windows machine to my local linux box.
I've therefore taken to blaming the server on the remote box, or the speed of the connection, but of course I don't really know what the problem is. Thankfully, if I keep trying long enough, the upload eventually succeeds. I've sometimes felt that it helps to unlink the truncated file from the remote server before re-attempting the scp_put.

You can perhaps get a better idea of the error, by doing:
if(!($ssh2 ->scp_put(${datafile},${dir}))) { my @error = $ssh2->error(); die ("@error"); }
Can someone examine the server logs at the other end for any clue for you ? (In my case, I'm given access to the remote server as a favour, so am not keen to seek that sort of assistance.)

Or maybe even the server could be put into debug mode for you ?

Other than that, is uploading with sftp (again using Net::SSH2) an option for you ? I haven't yet tried that, but it's something I intend to try next time I strike trouble with scp_put.

Finally, which version of perl are you running, which version of Net::SSH2 do you have, and how did you install it ? Tomorrow, I could upload the latest version of Net::SSH2, built against the latest libssh2 library to the uwinnipeg ppm repository, if you like. Not sure that it will fix the problem however ... didn't for me.

Cheers,
Rob

In reply to Re: Unable to transfer file with scp_put using Net::SSH2 by syphilis
in thread Unable to transfer file with scp_put using Net::SSH2 by tsandras

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!
  • 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, details, 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, summary, 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.