0

I have app made using app inventor.

From there users selects image from phone.

The app sends the file via POSTFILE method to a PHP file.

The PHP file normally gets the file contents using:

$data = php_compat_file_get_contents('php://input')

But my host is on GoDaddy so I cant upload using this method.

So I want to use cloudinary but I get it to work. Is is due to same GoDaddy shared server restrictions?

Heres the cloudinary Upload code in the PHP file:

\Cloudinary::config(array( 
  "cloud_name" => "rafsystems", 
  "api_key" => "94993346XXXXXX", 
  "api_secret" => "bIgBADFROG-aU1GFLfHEzeQjWs" 
));
$result = \Cloudinary\Uploader::upload("php://input", array("public_id" => $file1));

So what options do I have. I need to sort this out asap for myself and a client

Thanks

user2899094
  • 491
  • 1
  • 4
  • 17

1 Answers1

0
  1. Please note that the api_secret must not be revealed to the public. Please generate a new pair of api_key and api_secret from your account's settings page.
  2. We warmly recommend to upload the photo directly to Cloudinary from the browser (client-side upload), either signed or unsigned. Then, send the info, as returned by the upload response, to your PHP server?
Itay Taragano
  • 1,901
  • 1
  • 11
  • 12
  • I also need an answer to this question. Notice in his question that he is uploading from a native mobile application. There is no browser, there is no client side upload. I am "solving" this by passing base64 string from php, but for photos this string is too large. A 7mb photo chokes. – davecoffin Oct 04 '16 at 19:44