Let me see if I have this right. You're running your script on a desktop machine. You want it saved on a remote machine. You're not getting it saved there.

First tip. Follow the suggestions in perlstyle and have warnings on your open. Many things can go wrong, and the error messages will help you figure out which.

Secondly to solve your problem you need to have a way to directly access the filesystem. At a guess from the path you tried, the client is a Windows machine. In that case try to locate the network share then proper full path and open that directly. (Note, you need the path as it looks from the client machine, not as it looks from the webserver.) Be aware that you have to switch \ to /, or else double your \ in your strings.

There are many reasons why that might fail, including permissions on the webserver. In that case you need to talk with a sysadmin and get some other networking solution set up. One is to have an ftp server. Another is that if this is for a local workgroup, you could put the file in a shared directory (using the appropriate smb path) and then have a file:/// URL in the webserver. Another is to have a CGI program on the webserver that can accept a file upload and write it directly to the webserver.

Good luck. Often the solution to this kind of problem tends to be fairly simple, but finding the missing piece of information that makes it simple (eg the right way to name the remote directory) can be very frustrating...


In reply to Re: How to Set new file path for CSV file by tilly
in thread How to Set new file path for CSV file by Rocko19

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.