How can I auto upload a file to the server?

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default How can I auto upload a file to the server?

    I have a .txt file on my local Windows 2000 box that i want uploaded to a
    remote L.A.M.P. server with only one click.

    I want to have a link (shortcut) on my desktop when clicked it launches a
    web browser loaded with a remote .php script that automatically goes into
    C:\data\upload_me.txt and uploads "upload_me.txt"

    I know how to upload files using php with a "browse to file" html form, but
    i want to skip the form and have the file just upload automatically when the
    script is loaded.

    I don't know how to make the .php script automatically grab the file from my
    local box and upload it without any user intervention.

    Any suggestions?

    Thanks for you help,
    cheyrl.
    Jane Guest

  2. Similar Questions and Discussions

    1. file upload is killing my server with large files
      I am using a cffile to upload files to a directory on my server. I have my memory up to a gig on the java settings on the cold fusoin admin. I have...
    2. upload .mdb file to server
      Hello! Is there anyone to help me with my database problem? I'm uploading the database file (Ms Access file) but when I'm trying to put a a log in...
    3. [PHP] How can I auto upload a file to the server?
      But, as we all know, PHP doesn't run client side, so she'd have to turn her computer into a web server or run PHP from the command line. There...
    4. Is it possible to upload a file from Director to a web server?
      I've not used Director before, so apologies in advance if this is a very straightforward question. We are considering Director for a project where...
    5. Upload local file to server
      Is there an easy way to upload a local file to a server?
  3. #2

    Default Re: [PHP] How can I auto upload a file to the server?

    Hi,

    The exact mechanism you mentioned cannot be easily created with php.
    What you can do is the install PHP command line version on your system
    and upload directly with that using a php script completly bypassing the
    browser. In that case though you will need to create write the post data
    using your own script.

    In other words your php script opens the upload_me.txt files, opens an
    http connection to the server and writes the contents of the file as
    multipart/form-data. The browser does not come into the picture.

    all the best




    jane wrote:
    >I have a .txt file on my local Windows 2000 box that i want uploaded to a
    >remote L.A.M.P. server with only one click.
    >
    >I want to have a link (shortcut) on my desktop when clicked it launches a
    >web browser loaded with a remote .php script that automatically goes into
    >C:\data\upload_me.txt and uploads "upload_me.txt"
    >
    >I know how to upload files using php with a "browse to file" html form, but
    >i want to skip the form and have the file just upload automatically when the
    >script is loaded.
    >
    >I don't know how to make the .php script automatically grab the file from my
    >local box and upload it without any user intervention.
    >
    >Any suggestions?
    >
    >Thanks for you help,
    >cheyrl.
    >
    >
    >

    --
    [url]http://www.radinks.com/upload[/url]
    Drag and Drop File Uploader.
    Raditha Dissanayake Guest

  4. #3

    Default Re: [PHP] How can I auto upload a file to the server?

    You might look at SCP using the PuTTY SCP or another SSH client to
    securely upload the file. You could automate it in a batch file and
    make a short-cut to the batch file. Doing this over the web is not a
    good method like John said. If you use SCP you can setup an SSH key so
    that you are not prompted for a password, SCP was designed for this type
    of problem.

    Jason

    John W. Holmes wrote:
    > jane wrote:
    >
    >> I have a .txt file on my local Windows 2000 box that i want uploaded
    >> to a
    >> remote L.A.M.P. server with only one click.
    >>
    >> I want to have a link (shortcut) on my desktop when clicked it
    >> launches a
    >> web browser loaded with a remote .php script that automatically goes
    >> into
    >> C:\data\upload_me.txt and uploads "upload_me.txt"
    >>
    >> I know how to upload files using php with a "browse to file" html
    >> form, but
    >> i want to skip the form and have the file just upload automatically
    >> when the
    >> script is loaded.
    >>
    >> I don't know how to make the .php script automatically grab the file
    >> from my
    >> local box and upload it without any user intervention.
    >
    >
    > You can't. That would be a horrible security violation. Think of a
    > different method.
    >
    Jason Sheets Guest

  5. #4

    Default Re: [PHP] How can I auto upload a file to the server?

    Hi John,

    My Impression from Jane's mail was that she was thinking of using a PHP
    script on the client side and not the server side. Am i correct jane? If
    so there would not be security concerns. Obviously as john has so
    rightly pointed out php on the server side cannot access local files.

    The only effective way then would be to use signed java applets (which
    contrary to popular belief can access local files if you give it the
    right permissions)




    John W. Holmes wrote:
    > jane wrote:
    >
    >> I have a .txt file on my local Windows 2000 box that i want uploaded
    >> to a
    >> remote L.A.M.P. server with only one click.
    >>
    >> I want to have a link (shortcut) on my desktop when clicked it
    >> launches a
    >> web browser loaded with a remote .php script that automatically goes
    >> into
    >> C:\data\upload_me.txt and uploads "upload_me.txt"
    >>
    >> I know how to upload files using php with a "browse to file" html
    >> form, but
    >> i want to skip the form and have the file just upload automatically
    >> when the
    >> script is loaded.
    >>
    >> I don't know how to make the .php script automatically grab the file
    >> from my
    >> local box and upload it without any user intervention.
    >
    >
    > You can't. That would be a horrible security violation. Think of a
    > different method.
    >

    --
    [url]http://www.radinks.com/upload[/url]
    Drag and Drop File Uploader.
    Raditha Dissanayake Guest

  6. #5

    Default Re: [PHP] How can I auto upload a file to the server?

    From: "Raditha Dissanayake" <jabber@raditha.com>
    > My Impression from Jane's mail was that she was thinking of using a PHP
    > script on the client side and not the server side. Am i correct jane? If
    > so there would not be security concerns. Obviously as john has so
    > rightly pointed out php on the server side cannot access local files.
    True, kind of, and that's how I understood it also. But, as we all know, PHP
    doesn't run client side, so she'd have to turn her computer into a web
    server or run PHP from the command line. There still isn't a way to
    automatically submit a file over HTTP using either method, though.

    FTP would work, though...

    ---John Holmes...

    > John W. Holmes wrote:
    >
    > > jane wrote:
    > >
    > >> I have a .txt file on my local Windows 2000 box that i want uploaded
    > >> to a
    > >> remote L.A.M.P. server with only one click.
    > >>
    > >> I want to have a link (shortcut) on my desktop when clicked it
    > >> launches a
    > >> web browser loaded with a remote .php script that automatically goes
    > >> into
    > >> C:\data\upload_me.txt and uploads "upload_me.txt"
    > >>
    > >> I know how to upload files using php with a "browse to file" html
    > >> form, but
    > >> i want to skip the form and have the file just upload automatically
    > >> when the
    > >> script is loaded.
    > >>
    > >> I don't know how to make the .php script automatically grab the file
    > >> from my
    > >> local box and upload it without any user intervention.
    > >
    > >
    > > You can't. That would be a horrible security violation. Think of a
    > > different method.
    > >
    >
    >
    > --
    > [url]http://www.radinks.com/upload[/url]
    > Drag and Drop File Uploader.
    >
    > --
    > PHP General Mailing List ([url]http://www.php.net/[/url])
    > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
    >
    Cpt John W. Holmes Guest

  7. #6

    Default Re: [PHP] How can I auto upload a file to the server?

    >The only part i am having trouble with is making the remote script
    >automatically look into the local computer's hard drive and grab the .txt
    >file.
    <snip>
    >The problem with the code above is the path to the file does not show up
    >in the <input type='file'>, and the user would still need to click on the
    >'submit button' to upload the file.
    You're out of luck - for security reasons, the file input widget is
    intentionally resistant to scripting/styling.

    ---------------------------------------------------------------------
    michal migurski- contact info and pgp key:
    sf/ca [url]http://mike.teczno.com/contact.html[/url]
    Mike Migurski Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139