SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Perform Action on File Copy

  1. #1
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)

    Perform Action on File Copy

    Hello,

    I have a tricky problem hopefully someone can help me with.

    Basically I'm using a fairly isolated system that uses a basic upload and just moves it to a location on that server.

    The problem is, that server is fairly tiny (harddisk-wise), so I want to move them off of that.

    Is there any way that when a file is uploaded to a specific location I can run this file through another script (preferably PHP, but I can use just about anything) to push it up where I want.

    The place I want isn't accessible via fopen() or FTP, I have to use a specific API.

    Worst-case scenario I could create a processing script which is run every so often, but that's kind of inefficient.

    Thanks.

  2. #2
    <?php while(!sleep()){code();} G.Schuster's Avatar
    Join Date
    Mar 2007
    Location
    Germany
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have a look at "incron", that's like a "cronjob" for file "actions" (create, rename, delete etc.).
    It watches a filesystem tree and can trigger a script to take further action depending on the file action performed.

  3. #3
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    Nice.

    I think I've decided to go a different route, but I'll look into that for future use.

    Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •