2

I have a really weird problem

If I upload image less than 2 Mb(I don't know exact size) , there is not problem and if i print as dd;

UploadedFile {#530
  -test: false
  -originalName: "20170607_132957.jpg"
  -mimeType: "image/jpeg"
  -size: 883421
  -error: 0
  #hashName: null
  path: "/tmp"
  filename: "phpx8aY57"
  basename: "phpx8aY57"
  pathname: "/tmp/phpx8aY57"
  extension: ""
  realPath: "/tmp/phpx8aY57"
  aTime: 2017-10-09 06:12:07
  mTime: 2017-10-09 06:12:07
  cTime: 2017-10-09 06:12:07
  inode: 35785
  size: 883421
  perms: 0100600
  owner: 33
  group: 33
  type: "file"
  writable: true
  readable: true
  executable: false
  file: true
  dir: false
  link: false
}

But if I try upload image more than 2 mb and print as dd function();

UploadedFile {#530
  -test: false
  -originalName: "IMG_20171004_193910~3.jpg"
  -mimeType: "application/octet-stream"
  -size: 0
  -error: 1
  #hashName: null
  path: ""
  filename: ""
  basename: ""
  pathname: ""
  extension: ""
  realPath: "/var/www/api/test/public"
  aTime: 1970-01-01 00:00:00
  mTime: 1970-01-01 00:00:00
  cTime: 1970-01-01 00:00:00
  inode: false
  size: false
  perms: 00
  owner: false
  group: false
  type: false
  writable: false
  readable: false
  executable: false
  file: false
  dir: false
  link: false
}

There's not filename. And mimeType is looking application/octet-stream.

I tried raise system's upload size by php.ini but it's not working. And I need advice. Thank you.


I upload files to system as form-data

System: PHP 7.1 , Laravel 5.4

5
  • It seems you have default php 2mb upload limit. Exame php.ini upload section. Commented Oct 9, 2017 at 7:12
  • 1
    I wish I could mark as a duplicate Here is the reference stackoverflow.com/questions/28529518/… Commented Oct 9, 2017 at 7:34
  • @IvanBolnikh I wrote 70mb on this conf Commented Oct 9, 2017 at 7:39
  • @JayminNoob I saw this post and I tried what they advice but it does not work. Commented Oct 9, 2017 at 7:41
  • i have the same problem :| Commented Jan 10, 2019 at 15:29

3 Answers 3

1

Are you sure you changed both parameters in config file?:

post_max_size = 128M
upload_max_filesize = 128M
Sign up to request clarification or add additional context in comments.

2 Comments

post_max_size = 100M upload_max_filesize = 70M Now there is wrote
This took so long to figure out the issue. Thanks. THIS WORKS FINE
0

Use image intervention for image upload in laravel, Refer Docs, http://image.intervention.io/getting_started/installation

1 Comment

I think the problem is php sided. Image does not come in temp folder
0

I solved my problems. I tried to write wrong file path.

I printed php.ini --v on ubuntu server and server back file path as /etc/php/7.1/cli/php.ini but I printed phpinfo() function in index.php and I saw /etc/php/7.1/fpm/php.ini.

I don't know why they are different. I suppose they are same but they weren't.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.