Jump to content

[SOLVED] File Upload Array


monkeytooth

Recommended Posts

Ok, troubles..

 

I am making a small image upload script.. my issue is with this one variable.

 

$img = pathinfo($_FILES['file']['name']);

It creates an array like format so I can catch the file name prior to extension and the extension. My issue is I am noticing while testing if on the off chance I leave the input for the file empty I error my upload script. So I am trying to determine how I can catch if its empty so if it is, I can define an error to echo/print out. Only problem is everything I am trying doesnt seem to work.

 

empty($img)

!empty($img)

if($img == "")

if(!$img)

 

 

none of those seem to work for me. so I am kinda stuck, any ideas?

Link to comment
https://forums.phpfreaks.com/topic/172548-solved-file-upload-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.