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

alex29's avatar

UploadedFile path, filename, basename, pathname, and extension empty on Ubuntu

I tried uploading a file via the API I created, it's hosted on AWS with an Ubuntu distribution and I can't seem to figure out why these properties on the UploadedFile class (path, filename, basename, pathname, extension) are empty for some reason, were they not uploaded temporarily correctly? Is there anything I need to change first to have their values set?

This is what the UploadedFile class looks like on my local:

Illuminate\Http\UploadedFile {#409
  -test: false
  -originalName: "0-02-06-f629ead3712bed277d9bc1437dc60d92f4c9dd6b8974d9ed2bf7178fdbd924b1_1c6d9b4bc83577.mp4"
  -mimeType: "video/mp4"
  -error: 0
  #hashName: null
  path: "/private/var/folders/y1/g3bpww916vb422qqqxjpmtbm0000gp/T"
  filename: "phpC8YnE6"
  basename: "phpC8YnE6"
  pathname: "/private/var/folders/y1/g3bpww916vb422qqqxjpmtbm0000gp/T/phpC8YnE6"
  extension: ""
  realPath: "/private/var/folders/y1/g3bpww916vb422qqqxjpmtbm0000gp/T/phpC8YnE6"
  aTime: 2020-02-20 03:28:46
  mTime: 2020-02-20 03:28:46
  cTime: 2020-02-20 03:28:46
  inode: 10884157
  size: 2497377
  perms: 0100600
  owner: 502
  group: 20
  type: "file"
  writable: true
  readable: true
  executable: false
  file: true
  dir: false
  link: false
}

And this is what it looks like on my server:

Illuminate\Http\UploadedFile {#411
  -test: false
  -originalName: "0-02-06-f629ead3712bed277d9bc1437dc60d92f4c9dd6b8974d9ed2bf7178fdbd924b1_1c6d9b4bc83577.mp4"
  -mimeType: "application/octet-stream"
  -error: 1
  #hashName: null
  path: ""
  filename: ""
  basename: ""
  pathname: ""
  extension: ""
  realPath: "/var/www/html/gplayer-api/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
}
0 likes
4 replies
Talinon's avatar
Talinon
Best Answer
Level 51

@alex29

I suspect it's the upload_max_filesize setting within php.ini on the web server. Default is usually 2MB.

 size: 2497377   // over 2MB

the other clue is the mime type:

-mimeType: "video/mp4"  // local
 -mimeType: "application/octet-stream" // server

That suggests that it can't upload the file in its entirety because again of the max upload file size configuration.

1 like
alex29's avatar

i'll try setting it higher, but i already set it to 100M though even before the upload, also the value in the size property (this one 2497377), what is it in? i wanna convert it and see if it's higher than 100M (no way the video i uploaded is higher than 10MB though since it's only a couple seconds video of my son, not even a minute)

Talinon's avatar

You might want to check the post_max_size value, too.

I'm almost certain your problem will be one or the other.

Please or to participate in this conversation.