Upload File - Android to Google App Engine (PHP)

QuintoViento

From my Android app to Google App Engine, I'm POSTing a zip file; also I'm POSTing a string. When Google App Engine PHP script runs, I dump the value of $_FILES to the Log by...

ob_start();
var_dump($_FILES);
$result = ob_get_clean();
syslog(LOG_DEBUG, "VAR DUMP\n" . $result . "\n");

I also Log the value of the string. The Log has the string output but doesn't have the $_FILES dumped output. I read THIS LINK, but this seems to pertain to Web. My Android code to POST the file is as follows...

private void postExamplesZipToDrive(File file_zip){
    RequestParams request_params = new RequestParams();
    request_params.put("test", "Came thru");

    //
    try{ request_params.put("file_zip", file_zip); }
    catch(FileNotFoundException e){
        Log.e("postExamplesZipToDrive", "File not found");
        Toast.makeText(this, "Unable to upload.", Toast.LENGTH_SHORT).show();
        return;
    }

    AsyncHttpClient async_http_client = new AsyncHttpClient();

    async_http_client.post(UPLOAD_URL, request_params, new JsonHttpResponseHandler(){
         @Override
         public void onSuccess(int code_status, Header[] headers, JSONArray success) {
            Toast.makeText(getApplicationContext(), "" + code_status, Toast.LENGTH_SHORT).show();
            super.onSuccess(code_status, headers, success);
         }

         @Override
         public void onFailure(int code_status, Header[] headers, String string_response, Throwable throwable){
             Toast.makeText(getApplicationContext(), "" + code_status, Toast.LENGTH_SHORT).show();
             Log.e("onFailure", code_status + "\n" + string_response);
         }
    });
}

My question is, am I POSTing the .zip file correctly? How do I capture the files uploaded that are usually stored in $_FILES?

Mars

You can use the direct file upload function in php55 (see https://gae-php-tips.appspot.com/2015/03/09/direct-file-uploads-for-php-5-5/).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Upload File from App Engine to Google Drive

From Dev

Upload and read CSV file in google app engine

From Dev

Upload file from google app engine to google drive using java

From Dev

MultiValueDictKeyError Django Google App Engine - Multiple File Upload?

From Dev

upload a file using spring MultipartFile and google app engine

From Dev

Google app engine bulkloader opens empty file at upload

From Dev

MultiValueDictKeyError Django Google App Engine - Multiple File Upload?

From Dev

No Response on Google App Engine Java Blobstore Upload from Android

From Dev

Upload images to Google App Engine

From Dev

Google App Engine upload fail

From Dev

Cannot write to file on Google App Engine Dev server with PHP?

From Dev

Does the PHP file_exists function work in Google App Engine?

From Dev

Deploy Failed when Deploy on google App Engine (for upload on app engine)

From Dev

Upload photos from Android app to Google Cloud Storage/App Engine - illegal character '_'

From Dev

Google App Engine: Failing to Upload Data

From Dev

Upload image with google app engine fails

From Dev

Google App Engine No such file or directory:

From Dev

Google App Engine Cron PHP

From Dev

Android app engine backend entity upload

From Dev

Android app engine backend entity upload

From Dev

How to properly upload (image) file to Google Cloud Storage using Java App Engine?

From Dev

How to properly upload (image) file to Google Cloud Storage using Java App Engine?

From Dev

Google App Engine (GAE) and Android

From Dev

Google App Engine (GAE) and Android

From Dev

Android App and Google App Engine/Cloud SQL

From Dev

Upload Files To Google Cloud Storage With Google App Engine (Python)

From Dev

How to upload images to Google Cloud Storage using Google App Engine?

From Dev

How to use Google App Engine SDK for php in Google Compute Engine

From Dev

Android upload file in chunks to PHP

Related Related

  1. 1

    Upload File from App Engine to Google Drive

  2. 2

    Upload and read CSV file in google app engine

  3. 3

    Upload file from google app engine to google drive using java

  4. 4

    MultiValueDictKeyError Django Google App Engine - Multiple File Upload?

  5. 5

    upload a file using spring MultipartFile and google app engine

  6. 6

    Google app engine bulkloader opens empty file at upload

  7. 7

    MultiValueDictKeyError Django Google App Engine - Multiple File Upload?

  8. 8

    No Response on Google App Engine Java Blobstore Upload from Android

  9. 9

    Upload images to Google App Engine

  10. 10

    Google App Engine upload fail

  11. 11

    Cannot write to file on Google App Engine Dev server with PHP?

  12. 12

    Does the PHP file_exists function work in Google App Engine?

  13. 13

    Deploy Failed when Deploy on google App Engine (for upload on app engine)

  14. 14

    Upload photos from Android app to Google Cloud Storage/App Engine - illegal character '_'

  15. 15

    Google App Engine: Failing to Upload Data

  16. 16

    Upload image with google app engine fails

  17. 17

    Google App Engine No such file or directory:

  18. 18

    Google App Engine Cron PHP

  19. 19

    Android app engine backend entity upload

  20. 20

    Android app engine backend entity upload

  21. 21

    How to properly upload (image) file to Google Cloud Storage using Java App Engine?

  22. 22

    How to properly upload (image) file to Google Cloud Storage using Java App Engine?

  23. 23

    Google App Engine (GAE) and Android

  24. 24

    Google App Engine (GAE) and Android

  25. 25

    Android App and Google App Engine/Cloud SQL

  26. 26

    Upload Files To Google Cloud Storage With Google App Engine (Python)

  27. 27

    How to upload images to Google Cloud Storage using Google App Engine?

  28. 28

    How to use Google App Engine SDK for php in Google Compute Engine

  29. 29

    Android upload file in chunks to PHP

HotTag

Archive