Post a file to a different location than requesting server

Posted on 2012-08-26
Last Modified: 2012-08-27
We are using a third party to store and stream uploaded audio files.  Our website has a simple html form on it to originally upload the audio file to the third party via the API of the third party.

My bossman has an issue that the uploaded files, while correctly ending up in the server of the third party, use the bandwidth of our server (like our site is being used as a proxy server).  He wants it to go right from the user to the thirdparty via post, and not create all that bandwidth usage on our server.

My general question, is that even technically allowed with $_FILE, or another way, if the user is starting from our site?
Question by:christamcc
    LVL 82

    Accepted Solution

    It depends...  If the next page after the form submission needs to be on your server, then no.  To go directly to the third party server, you would have to have them redirect back to your server after the upload.

    You can't post to your page but have the file go directly to the other server.  There is no method available that can make that happen.
    LVL 107

    Expert Comment

    by:Ray Paseur
    Show us a little more about the 3rd party API, please.  Is there a man page that documents it?  If so, we might be able to help you with this process.

    Also, if the bandwidth consumed on your server is only 2X the number of files (once to upload, and once to forward) and this is creating a business problem for your company you might consider getting a better hosting package.  Just a thought... ~Ray

    Author Comment

    Thanks!  I think that's enough info.  We have reached out to the third party, I just wanted to get a general idea of of the problem ....

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now