Problems with php file upload (some file types don't work need to upload a ".eml")

Dear experts,

I have a problem with the php upload. it works great with text files but when I try to upload ".eml" it doesn't work :(

Error is:
Notice: Undefined index: file_upload in c:\program files\easyphp1-8\www\upload\_upload_process.php on line 14
has been uploaded.

My code is:


//File upload
$target_path = "data_sets\/";
 if (is_uploaded_file($_FILES['file_upload']['tmp_name']))
$original_name=explode(".", $_FILES['file_upload']['name']);
  $filename = $target_path.$original_name[0]."_uploadDATE_".$today."_USER_".$_SESSION['user'].".txt";
  move_uploaded_file($_FILES['file_upload']['tmp_name'], $filename);
echo $_FILES['file_upload']['name']." has been uploaded.";

It works with nearly all types of files, but not the ones I need (".eml")... Any ideas?
Who is Participating?
SamsonChungConnect With a Mentor Commented:
try increasing the file size on your php.ini file.

There are several sections you want to increase, first the max memory usage. Default is 2 or 8 mb, I changed mine to about 20 mb.

just look for all of these in your php.ini and you'll find them. They are all there.

Primary cause for your problem is memory limitation. php can't use more memory then you are allowing it to use.
hernst42Connect With a Mentor Commented:
check $_FILES['file_upload']['error'] and compare the value to
Are you sure you upload-form is valid?
RoonaanConnect With a Mentor Commented:
I would go with the suggestion hernst42 provided before changing your configuration.

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

ChoobsTechAuthor Commented:
Sometimes the obvious doesn't strike my mind... Thanx a lot guys! this was quick and efficient!

Points are:
hernst42 -> 190 (partially helped)
SamsonChung -> 300 (fixed my issue)
Roonaan -> 10 (Nice input :D )
ChoobsTechAuthor Commented:
minimum split was 20 points... Roonnan +10, hernst42  -10.

I think it's fair. Should you feel like it has been unequal please tell me. I'll try to improve next time :D
Thank You.

Glad to help... Actually I ran into a similar problem a few weeks ago. that's why I knew how to fix it so fast :p.

I was trying to fix an upload section for my webpage... which was later scraped and I used a blogging software instead ... How much more lazy can I get?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.