php - AJAX file upload with secret query vars -


we're creating form allows users upload large files. on mobile devices , slow connections, might take while upload, seems important handled ajax call shows users progress bar (or let them know it's still working).

here's problem: endpoint upload 3rd party api expects our secret api key 1 of parameters. here's link directly the section in documentation. api key cannot exposed users on client side.

my first instinct submit form intermediate php script on our site, has api key, , uploads file api. i'm pretty sure mean uploading file twice: once our server. again our server api endpoint. if form submitted ajax, it's not great result user wait twice long complete.

so: what's smoothest way let users upload files while keeping our api key safe?

some details may or may not important:
our site php web app built on cakephp framework (v2.x). files being uploaded video files of different formats between 1 , 5 minutes long. api company called wistia (see link docs above). file sizes seem range 3-30mb. have no ability change way 3rd party api works.

uploading twice shouldn't issue - should it?

its server api - servers , apis meant - exchanging data.

javascript not meant this.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -