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:

$_SESSION['user']="XYZ";

//File upload
$today=date('d_m_Y_\a\t_G\h_i\m_s\s');
$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?
LVL 2
ChoobsTechAsked:
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.
0
 
hernst42Connect With a Mentor Commented:
check $_FILES['file_upload']['error'] and compare the value to http://www.php.net/manual/en/features.file-upload.errors.php
Are you sure you upload-form is valid?
0
 
RoonaanConnect With a Mentor Commented:
I would go with the suggestion hernst42 provided before changing your configuration.

-r-
0
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 )
0
 
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
0
 
SamsonChungCommented:
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?
0
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.