473,395 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Error uploading files

60
[PHP]<?
if(empty($_POST)){ ?>
<html>
<body>
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="10240000">
Archivo: <input type="file" name="arch"><br><br>
<center><input type="submit" value="Subir Archivo"></center>
</form>
</body>
</html> <?

}else{
$rn = $_FILE['arch']['name'];
$tn = $_FILE['arch']['tmp_name'];

if(is_uploaded_file($tn)){
if(move_uploaded_file($tn, $rn)){
echo "Archivo "."<b>".$rn."</b>"." subido";
unlink($tn);
}else{
echo "Error al mover archivo ".$tn;
}
}else{
echo "Error al subir archivo";
}
}

?>[/PHP]

why doesn't it uploads the file i select ???

it always prints Error al "subir archivo"

in php.ini the maxsize is 32MB so that isn't the problem
May 28 '07 #1
3 1752
pbmods
5,821 Expert 4TB
Try using:

Expand|Select|Wrap|Line Numbers
  1. print_r($_FILE);
  2.  
To make sure the file was uploaded properly. Especially pay attention to the 'error' index. You can look up the error code here.
May 28 '07 #2
pplers
60
thanks, but the problem was very stupid:

$_FILE xD --> while it should be $_FILES
May 30 '07 #3
pbmods
5,821 Expert 4TB
*pause*

Yes. That problem should be ashamed of itself!

Heh.

*grumble* wow HOW did I miss that one???
May 31 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Marc | last post by:
Hello, I have a page where i can upload binary file (using the HTML input type=file approach). This works fine for relatively small files (<6MB)) but when files get bigger (13MB) there is a...
4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
1
by: Nikhil | last post by:
I have a VBscript that I use to upload files onto the server. The script works fine on IIS 5.0 but on IIS 6.0 on Windows 2003 I get an error when uploading certain files. I believe its because the...
7
by: Joe | last post by:
I have an upload file operation in the web application. UploadForm.asp is the form, and UploadAction.asp is the form processing. //UploadForm.asp <FORM NAME="InputForm"...
5
by: hb | last post by:
Hi, In my ASP.Net application 'MyWebApp' , the mode="StateServer" in <sessionState> of Web.config file, and the ASP.NET State Service is set to start automatically on the server. But every...
2
by: GD | last post by:
Hi, An intranet application, with a SMTP mail function that lets users to attach files with emails by selecting files in their local computers (through a file browser component), works perfect on...
1
by: wenqiang7 | last post by:
I am encountering a very strang problem with file uploading in my ASP.Net page. When we try to upload certain file, we'll get an error msg of "Cannot find server or DNS Error". We are running...
0
by: PerumalSamy | last post by:
Hi, I am getting following error while uploading my project in web. Description: An error occurred during the processing of a configuration file required to service this request. Please review...
3
by: muziburrehaman | last post by:
i am looking for code in php to upload the 1 gb files. any one can please help me by sending the code....
4
rahulephp
by: rahulephp | last post by:
i think i am missing something in the below script: It shows error an do not upload files to destination: Let me know how to solve this: <?php if (isset($_POST)) { $uploadArray=...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.