Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

usagar80's avatar

Uploading Larger files making issue

Hi all, I am trying to upload files on my Server but that work for only small files. I have change necessary settings i.e. Upload Max Size, Post max SIze, Execution timout.

Below, are the output of dd($file) where $file is file from My Request.

Small File

UploadedFile {#1319 ▼
 -test: false
 -originalName: "credentials.csv"
 -mimeType: "application/vnd.ms-excel"
 -size: 198
 -error: 0
 path: "H:\xampp\tmp"
 filename: "php4EAA.tmp"
 basename: "php4EAA.tmp"
 pathname: "H:\xampp\tmp\php4EAA.tmp"
 extension: "tmp"
 realPath: "H:\xampp\tmp\php4EAA.tmp"
 aTime: 2018-08-09 10:06:37
 mTime: 2018-08-09 10:06:37
 cTime: 2018-08-09 10:06:37
 inode: 0
 size: 198
 perms: 0100666
 owner: 0
 group: 0
 type: "file"
 writable: true
 readable: true
 executable: false
 file: true
 dir: false
 link: false
 linkTarget: "H:\xampp\tmp\php4EAA.tmp"
}

Large file

UploadedFile {#1329 ▼
  -test: false
  -originalName: "video.mp4"
  -mimeType: "application/octet-stream"
  -size: 0
  -error: 1
  path: ""
  filename: ""
  basename: ""
  pathname: ""
  extension: ""
  realPath: "D:\Project\Code\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
}

It's look like there is no file in Request. BUt Can't figure out what I did miss.

0 likes
2 replies
usagar80's avatar

Sorry guys, Issue was I made changes into php.ini file but those changes was not enough to make file upload work.

pardeepkumar's avatar

File upload is an essential aspect of any project. Given this importance, it is surprising that many developers face challenges of adding file upload feature to their projects. In particular, developers are unsure about how to upload and validate files. If you want to upload big files you should use streams. Here’s the code to do it:

$disk = Storage::disk('s3');
$disk->put($targetFile, fopen($sourceFile, 'r+'));

For more information suggest you to follow this article steps:

https://www.cloudways.com/blog/laravel-multiple-files-images-upload/

Please or to participate in this conversation.