Uploading file in postman extension

PARTHIBAN M

I try to upload an image via the postman extension, but I get the following response. Furthermore, the image does not appear in the specified directory.

{
    "name": "PHP Notice",
    "message": "Undefined index: user_id",
    "code": 8,
    "type": "yii\\base\\ErrorException",
    "file": "C:\\xampp\\htdocs\\basic14-4-2016\\controllers\\ApiuploadsController.php",
    "line": 85,
    "stack-trace": [
        "#0 C:\\xampp\\htdocs\\basic14-4-2016\\controllers\\ApiuploadsController.php(85): yii\\base\\ErrorHandler->handleError(8, 'Undefined index...', 'C:\\\\xampp\\\\htdocs...', 85, Array)",
        "#1 [internal function]: app\\controllers\\ApiuploadsController->actionNew()",
        "#2 C:\\xampp\\htdocs\\basic14-4-2016\\vendor\\yiisoft\\yii2\\base\\InlineAction.php(55): call_user_func_array(Array, Array)",
        "#3 C:\\xampp\\htdocs\\basic14-4-2016\\vendor\\yiisoft\\yii2\\base\\Controller.php(151): yii\\base\\InlineAction->runWithParams(Array)",
        "#4 C:\\xampp\\htdocs\\basic14-4-2016\\vendor\\yiisoft\\yii2\\base\\Module.php(455): yii\\base\\Controller->runAction('new', Array)",
        "#5 C:\\xampp\\htdocs\\basic14-4-2016\\vendor\\yiisoft\\yii2\\web\\Application.php(84): yii\\base\\Module->runAction('apiuploads/new', Array)",
        "#6 C:\\xampp\\htdocs\\basic14-4-2016\\vendor\\yiisoft\\yii2\\base\\Application.php(375): yii\\web\\Application->handleRequest(Object(yii\\web\\Request))",
        "#7 C:\\xampp\\htdocs\\basic14-4-2016\\web\\index.php(12): yii\\base\\Application->run()",
        "#8 {main}"
    ]
}
mohit

If you want to upload image from postman then you can use this way -

In PostMan

  1. Use POST request
  2. Select form-data radio button
  3. Enter key(image) and select file type right after value textfield to upload file

In Yii2 code

  1. write this code in controller

  2. $image = \yii\web\UploadedFile::getInstanceByName('image');

  3. Move temp file in $image to your server


You'll get all necessary details in $image variable to upload image.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Validating file extension in AngularJs before uploading

From Dev

How to correct the extension specification in this file uploading script?

From Dev

Get the file name and the extension while uploading file in PhoneGap

From Dev

Get the file name and the extension while uploading file in PhoneGap

From Dev

Can I restrict uploading certain file extension in github.com?

From Dev

uploading file from local storage to server with a chrome extension

From Dev

Display image and Validation of image extension before uploading file Using Javascript

From Dev

Where in the code can I change file extension to lowercase before uploading?

From Dev

How to prevent extension changed malicious file uploading from users

From Java

Current request is not a multipart request Spring Boot and Postman (Uploading json file plus extra field)

From Dev

Check file extension before uploading file in asp.net web api

From Dev

Validate file extension before uploading whole file formidable (node.js)

From Dev

Validate file extension before uploading whole file formidable (node.js)

From Dev

File not Uploading in File Reader

From Dev

Chrome Postman Extension No Longer Available?

From Dev

Uploading image as Parse File

From Dev

Drag and Drop File Uploading

From Dev

SQL Dump File uploading

From Dev

Uploading file on server

From Dev

Error uploading a file in Laravel

From Dev

Uploading file in python flask

From Dev

Handle file uploading with go

From Dev

uploading FormData with file attachment

From Dev

Uploading a file with FormData and multer

From Dev

Uploading file with jQuery Ajax

From Dev

issue with file uploading in laravel

From Dev

Uploading a code file to wordpress

From Dev

Javascript - File uploading, readAsArrayBuffer?

From Dev

uploading and processing file progress

Related Related

  1. 1

    Validating file extension in AngularJs before uploading

  2. 2

    How to correct the extension specification in this file uploading script?

  3. 3

    Get the file name and the extension while uploading file in PhoneGap

  4. 4

    Get the file name and the extension while uploading file in PhoneGap

  5. 5

    Can I restrict uploading certain file extension in github.com?

  6. 6

    uploading file from local storage to server with a chrome extension

  7. 7

    Display image and Validation of image extension before uploading file Using Javascript

  8. 8

    Where in the code can I change file extension to lowercase before uploading?

  9. 9

    How to prevent extension changed malicious file uploading from users

  10. 10

    Current request is not a multipart request Spring Boot and Postman (Uploading json file plus extra field)

  11. 11

    Check file extension before uploading file in asp.net web api

  12. 12

    Validate file extension before uploading whole file formidable (node.js)

  13. 13

    Validate file extension before uploading whole file formidable (node.js)

  14. 14

    File not Uploading in File Reader

  15. 15

    Chrome Postman Extension No Longer Available?

  16. 16

    Uploading image as Parse File

  17. 17

    Drag and Drop File Uploading

  18. 18

    SQL Dump File uploading

  19. 19

    Uploading file on server

  20. 20

    Error uploading a file in Laravel

  21. 21

    Uploading file in python flask

  22. 22

    Handle file uploading with go

  23. 23

    uploading FormData with file attachment

  24. 24

    Uploading a file with FormData and multer

  25. 25

    Uploading file with jQuery Ajax

  26. 26

    issue with file uploading in laravel

  27. 27

    Uploading a code file to wordpress

  28. 28

    Javascript - File uploading, readAsArrayBuffer?

  29. 29

    uploading and processing file progress

HotTag

Archive