Announcement

Collapse
No announcement yet.

Copy File from "data" directory to "script" directory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Copy File from "data" directory to "script" directory

    Hey guys,

    I have small bit of my code that uses scopy to copy an uploaded file into the a file in the "script" (publically viewable) directory. However everything I try it this line fails. I'm using like:

    scopy(l.uploaded_file, l.destination_path)

    It fails however. Any ideas as to why or how to fix?

    l.destination = g.Module_Root $ '/mod_code/' $ l.file_name

    Help?

    #2
    Re: Copy File from "data" directory to "script" directory

    Do you know exactly what sort of fail or error you get? Maybe an ownership/rights problem?

    Comment


      #3
      Re: Copy File from "data" directory to "script" directory

      Tried that. Doesn't seem to be the issue here. The folder I'm transferring to I changed to 777, just to test. Still nothing. Also it works when moving files in the "data" directory. Just this simple change from "data" to "script" isn't working (fcopy -> scopy).

      Comment


        #4
        Re: Copy File from "data" directory to "script" directory

        Have you checked the ownership of the folders? Often the script directory is "user.user" and the data directory is "user.group".

        And I know it sounds like a kluge, but sometimes you can move them if you first have your script create a destination folder - and then copy into it, then copy it to where you want. Can't explain more than that because I remember I had to do that on one system a long time ago; but can't remember the where/when/why of it.

        I am sure that when other folks get awake they will be able to offer much more rational responses.

        Comment


          #5
          Re: Copy File from "data" directory to "script" directory

          Zach:

          You need to use fscopy instead of scopy:
          http://www.mivascript.com/item/mivas...ns/fscopy.html

          scopy only works within the scripts location.
          Gordon Currie
          Phosphor Media - "Your Success is our Business"

          Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
          phosphormedia.com

          Comment


            #6
            Re: Copy File from "data" directory to "script" directory

            Originally posted by Gordon - Phosphor Media View Post
            You need to use fscopy instead of scopy:
            http://www.mivascript.com/item/mivas...ns/fscopy.html
            Thanks Gordon, I ended up finding that too. Works like a charm now.

            Comment

            Working...
            X