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

Posted on 2007-10-15
Last Modified: 2010-08-05
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?
Question by:ChoobsTech
    LVL 48

    Assisted Solution

    check $_FILES['file_upload']['error'] and compare the value to
    Are you sure you upload-form is valid?
    LVL 6

    Accepted Solution

    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.
    LVL 49

    Assisted Solution

    I would go with the suggestion hernst42 provided before changing your configuration.

    LVL 2

    Author Comment

    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 )
    LVL 2

    Author Comment

    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
    LVL 6

    Expert Comment

    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?

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now