Results 1 to 4 of 4

Thread: Simple Apache setup to accept POSTed files

  1. #1
    Join Date
    Jun 2013
    Beans
    2

    Simple Apache setup to accept POSTed files

    Hi all,

    Noobiest of noob questions, but I have been searching and experimenting for days without success. For a project I am working on, I just need to set up a local test server that can accept files sent via HTTP POST (reports are being sent automatically via POST, I just need to verify the reporting mechanism is working properly). So I set up Apache on my Ubuntu 12.04 laptop but cannot seem to get much farther.

    I assume that I need to set up a script (php or otherwise) to allow the server to accept the files? Security is not an issue, this is all done on the local network. Any apache gurus mind setting me straight?

    I found some php code and the associated html to allow me to upload a file using a simple web page, which works fine, so I know the apache setup can actually receive files. But whenever I use curl to POST a file I just get back the text of the index.html.

    Please help?

    Thanks!

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    10,881
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Simple Apache setup to accept POSTed files

    If you use the upload handler in PHP, read this:

    http://php.net/manual/en/features.file-upload.php
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Jun 2013
    Beans
    2

    Re: Simple Apache setup to accept POSTed files

    Quote Originally Posted by SeijiSensei View Post
    If you use the upload handler in PHP, read this:

    http://php.net/manual/en/features.file-upload.php
    Thanks for the help, I appreciate it! I ended up ditching trying to do it with PHP and went with Tomcat and a java servlet and was able to code it pretty quickly that way.

    Thanks again!

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    10,881
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Simple Apache setup to accept POSTed files

    You're welcome. Not knowing Java, that wouldn't be an option for me!

    HTTP POST is an annoying protocol for an application to employ because you have to code a POST handler somewhere. I much prefer writing files at the OS level and moving them securely with rsync, OpenVPN, or sshfs.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

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
  •