Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2007-10-15
6
Medium Priority
?
289 Views
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:

$_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?
0
Comment
Question by:ChoobsTech
6 Comments
 
LVL 48

Assisted Solution

by:hernst42
hernst42 earned 720 total points
ID: 20079677
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
 
LVL 6

Accepted Solution

by:
SamsonChung earned 1200 total points
ID: 20079688
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
 
LVL 49

Assisted Solution

by:Roonaan
Roonaan earned 80 total points
ID: 20079954
I would go with the suggestion hernst42 provided before changing your configuration.

-r-
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 2

Author Comment

by:ChoobsTech
ID: 20080020
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
 
LVL 2

Author Comment

by:ChoobsTech
ID: 20080040
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
 
LVL 6

Expert Comment

by:SamsonChung
ID: 20081631
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

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Suggested Courses
Course of the Month20 days, 19 hours left to enroll

810 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