Re: automated upload with PHP



On 30 Mar, 04:49, "Aerik" <asyl...@xxxxxxxxx> wrote:
On Mar 29, 8:29 pm, "Steve Poe" <steve....@xxxxxxxxx> wrote:



sure, you can script on the client using what is called active
scripting.
its nice and familiar, so you would either
1) have your script one once per day and upload any images not already
uploaded from a set of folders
2) configure explorer so you can right click and select upload image,
your php script would be run in the bvackground with argument such as
c:\path\to\php -r "%1"
and it would do the rest.
Why not use FTP if you are scripting this, as it will be nice and
robust and can interact is a predicatable way with your fileserver -
providing it can have an ftp serve running on it, like filezilla
server.

oops I should have added, that if you have a few computers you need to
install this on you could use NSIS (Nullsoft Scriptable Install
System)http://nsis.sourceforge.net/Main_Pagetowrapup everything
including the script that makes the right click functionality between
tiffs and the php script, and distribute that.

Thanks for your help (and the link). I am not familar with
implementing
FTP through PHP. It's mainly PHP with HTML forms. The PHP app runs on
a
Linux box (hopefully this does not matter) and I believe it also has
ftp access. At this point, there will only be one computer that the
PHP application will need to automatically load
the TIF image. The file will be saved in a directory called xrays off
of the C:\
drive.

Steve

Hi Steve -
Would it suit your requirement to hard code the path into the file
upload box? The user still has to click "upload" but will not have to
find the file each time.

Aerik



active scripting is slightly different, it will run on the windows box
where the tiffs are. php on the linux server isnt used at all. I
thought you question was really about "automatic form submission" but
this isnt allowed for security, so you have to program on the client
computer itself. You can do this in any language of course, and
because you seemed familiar with php, I just thought why not use php
on the client too.
For instance, my desktop here does a whole load of things at night,
all using php. It scans direcories and uploads files to an ftp server,
backs stuff up, copies files, and logs the results.

What I would do is
a) download and use a file/folder watcher like log monitor
http://www.freeware-guide.com/download/index2.html
b) set it to automatically run a program (like copy blah to network
drive blah) which uploads the changes
c) write a small program that takes a path and filename and uploads it
to the linux machine over ftp, or if you script using c#, you can just
copy the file there using a mapped drive and samba.

You dont need your users to interact with this process. It is done
automatically. If the images need to get to the file server in real
time, then you can use the watcher, otherwise you can run cronw 2
(sourceforge) to sweep them all there at night.

The reason I keep steering away from http uploads is because they tend
not to be as robust as ftp. FTP can support resume, and other nice
features like compression, (if your code does). You can though script
an automatic form upload using c# or php or whatever, which is just a
script - rather than one that runs in a browser. If you like c#
or .NET check out codeproject for more.



.



Relevant Pages

  • Re: automated upload with PHP
    ... have your script one once per day and upload any images not already ... tiffs and the php script, ... // request local file read permission ...
    (comp.lang.php)
  • Re: file creation: ownership
    ... >> I am hosting a blog on which I can upload pictures. ... first an applet uploads the picture by ftp and then a php ... finds the newly uploaded images and creates thumbnails with gd. ...
    (comp.lang.php)
  • Re: file upload problem
    ... I am trying to learn about uploading files with php. ... I made a simple form script and and file up load script. ... The form script gets the file name correctly and seems to pass it to the upload script correctly. ... if I echo ini_getI see ...
    (comp.lang.php)
  • Re: file upload problem
    ... I am trying to learn about uploading files with php. ... I made a simple form script and and file up load script. ... The form script gets the file name correctly and seems to pass it to the upload script correctly. ... if I echo ini_getI see ...
    (comp.lang.php)
  • Re: automated upload with PHP
    ... have your script one once per day and upload any images not already ... providing it can have an ftp serve running on it, ... tiffs and the php script, ...
    (comp.lang.php)