User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 397,858 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,380 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 680 | Replies: 1 | Solved
Join Date: Dec 2007
Posts: 52
Reputation: kishou is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
kishou kishou is offline Offline
Junior Poster in Training

$_FILES help

  #1  
Feb 2nd, 2008
sry i'm not really familiar with $_FILES. but i have a quick question. why isnt this uploading?
here's my code:
<?php
$file = rand(10,100) . $_FILES["file"]["name"];
if ((($_FILES["file"]["type"] == "application/octet-stream"))
&& ($_FILES["file"]["size"] < 400000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $file . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
if (file_exists("themes/" . $file))
{
echo $file . " already exists. ";
}
else
{

move_uploaded_file($file,
"themes/" . $file);
echo "Stored in: " . "themes/" . $file;
}
}
}
else
{
echo "Invalid file. Must be .ptf.";
}
?>
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 8:31 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC