Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Upload A File But I Always Get The Error Message: Possible File Upload Attack!


I'm trying to upload a file but I always get the error message: Possible file upload attack! Code:




View Complete Forum Thread with Replies

Related Forum Messages:
PHP File Upload Unexpected Error - File Too Large?
I have a short basic script to upload files. It works fine with small files,
but with longer files it gets stuck.

Here's the fragment, the input file is loaded in "$file" from an HTML form
as usual.

....
$img_str = fread(fopen($file, "r"), filesize($file));
$data = addslashes($img_str);
// --------------------- up to here the execution is correct and fast (<1
second)

$sql="INSERT INTO $table (".
" file_name,".
" file_type,".
" file_size,".
" bin_data)".
" VALUES (".
" '$file_name',".
" '$file_type',".
" '$file_size',".
" '$data')";
// --------------------- it gets stuck
here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
mysql_query($sql) or die ("SQL error ..$sql");

I have already set the php.ini variables as follows:
memory_limit = 16M
upload_max_filesize = 6M

I also checked the execution time to max_execution_time = 300 (even though I
don't believe it should be necessary).
The server is a P4 1.8 GHz, 256MB RAM

View Replies !
File Upload Issue - Unable To Upload A Large File
I am using PHP Version 4.4.3 under Linux/Apachie to upload files.
The PHP.ini upload_max_filesize is 2M, which I need to override this
in the HTML (see below). I changed the MAX_FILE_SIZE to 4,000,000
but the system only accepts files less than 2M.

Is the override wrong, do I need to raise the limit in the PHP.ini
file, or is the Apachie issue.

<form name="upload" action="admin.php" method="post"
enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="4000000">

View Replies !
File Upload Error
I am constantly getting this error when I try to run a php script (form based) that allows a user to upload a file...

Warning: copy(/files/jack_album.jpg): failed to open stream: No such file or directory in /home/seeasale/public_html/load.php on line 155
Error Uploading File.

Things I know...

- the file does exist on my hard drive
- permissions are set correctly for the folder on the server (777)
- the files folder does exist (I have tried several ways to reference it in the .php file - all give the same error result).

View Replies !
File Upload Not Working But No Error...
I have a file upload page, and I've had it working fine, it was
beautiful :-) Anyway, the powers that be moved hosts... and it doesn't
work now.

The file name is correct, the directory where it's going on the
server is correct (checked through prints etc.). I've changed the dir
to 777 (is that right?) and this is what I get on the
print_r($_FILES); line:

Array
(
[userfile] => Array
(
[name] => amy.txt
[type] => text/plain
[tmp_name] => /tmp/phpccPHUE
[error] => 0
[size] => 39
)

)

And the file is not uploading - I'm getting an error on the line:

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
{.....

View Replies !
File Upload MAX_FILE_SIZE Error
I've built a rather simple file uploader. It works with any type of file given. I need it to go up to 30 meg for a limit. MY max_file_size hidden field is set to 31000000 which is 31,000,000 bytes or 31 megs. My php.ini max file size is set to 300m and my timeout at 3600 seconds, which is an hour. Code:

View Replies !
File Upload Script Error
i have the following code which will upload a file onto the server however i get the following errors.

Warning: move_uploaded_file(stuff/Correct VT1.xls) [function.move-uploaded-file]: failed to open stream: Permission denied in /var/www/html/upload.php on line 52

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpblvC1H' to 'stuff/Correct VT1.xls' in /var/www/html/upload.php on line 52

Somthing is wrong with uploading a file. Code:

View Replies !
File Upload Incomplete (error 3)
I am trying to upload JPG pictures to an online catalog app and it is not working. I get a error code of 3, which means that the upload was supposedly incomplete. The "name" element of the array does contain the correct file name so I know that an upload is at least attempted.

My timeout values and max size values, including the one in the hidden html field are all set to suitably large values. I have tried it on both Firefox and IE browsers and it does the same thing. There are no errors being logged other than the usual 404 on the favicon.ico and startup and shutdown messages. Code:

View Replies !
$_Post Error In File Upload
Although I can upload files with my script, I am having difficulty with getting my script to retrieve input data from the other fields. I have tried a few alterations to it but nothing gets shown as a post. Code:

View Replies !
Csv File Upload Giving Error
see my code inserting first two records into database twice Code:

View Replies !
File Upload Problems - Upload A File To The Server.
I am trying to upload a file to the server.
http://chops.novatrope.com/game/test/form2.html
Here is some more debugging info:Array
(
[userfile] =Array
(
[name] =Pequot.gif
[type] =>
[tmp_name] =>
[error] =3
[size] =0
)

)

I am usiing code from the php manual.
Here is the php info http://chops.novatrope.com/info.php

<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.

$uploaddir = '/usr/home/arthur/public_html/game/test/uploads/'
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>'
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.
";
} else {
echo "Possible file upload attack!
";
}

echo 'Here is some more debugging info:'
print_r($_FILES);

print "</pre>";

?>

and here is my html

<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="getfile2.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />
<!-- Name of input element determines name in $_FILES array -->
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>

View Replies !
Upload Problem - No Error Message.
I have a file upload set up from a form, which works fine with small
files (6k) but fails silently with larger ones (16k and up).

The form has:

<input type="hidden" name="MAX_FILE_SIZE" value="1000000">

and the script handling the uploads has:

set_time_limit(3000); // no difference with set_time_limit(0)
ignore_user_abort(true);

which should provide ample time for whatever needs to happen. The sever is
not running under safe mode.

When the upload fails, nothing happens in the browser: after the files
appear to have been sent (as measured by the time it takes for activity to
stop on my line monitor), the original form is still there, and I see no
error message.



View Replies !
PHP File Upload Limit, Error When Over Riding
I used to have a line in my .htaccess file that over rode the 2mb limit (php_value upload_max_filesize 10M). But recently my server (jumba.com.au) has introduced something new which won't let this work. I get the following error:

Internal Server Error:
The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@domain.com.au and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. Is there another way to up this file upload limit or should i look at different servers?

View Replies !
Return File Size Upload Error
when the server/PHP returns file size error? Is it after the file has been uploaded to the temp directory or before? Will the file actually have to reside in the temp folder for PHP to know it's too large?

How PHP deal with the MAX_FILE_SIZE input form field and at which point does it realize the file is too large? I've read some browsers can also use this field to prevent too large file uploads before sending it to the server.

View Replies !
File Upload Problem - Upload Multiple Files
I'm trying to upload multiple files. I'm using the chm file from
php.net to help me figure it out. I also checked online and say theres a
problem with the file. Anyway My html looks like this:

View Replies !
Upload Jpg With Ftp -fine, Upload With Php Wrong File Type!
i've scripted a file uploader, about as basic as you can get, and works on all accounts except that it tells me every single jpg is the wrong file type - BUT i can ftp all these same images and they all behave correctly.

echo filetype($type_file);

//got this warning
Warning: filetype() [function.filetype]: Lstat failed for image/pjpeg
any ideas?

View Replies !
Fatal Error: Allowed Memory Size - Upload A 2MB File
I'm using TikiWiki and was using its file upload feature, trying to
upload a 2MB file. I get this error:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 1677706 bytes) in
/var/html/www/tiki/lib/filegals/filegallib.php on line 30

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 40 bytes) in Unknown on line 0

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 134 bytes) in Unknown on line 0

My settings are:

PHP Version 4.2.2
Apache/2.0.40 (Red Hat Linux)
memory_limit 8M
post_max_size 8M
upload_max_filesize 5M
upload_tmp_dir no value
(the machine has 512 MB RAM)

No one else is using this server, and that was the only thing I was
trying to do (i.e. upload a 2MB file).

View Replies !
WYSIWYG Editor File Upload With Permission Denied Error
i am using an WYSIWYG editor (spaw2) in my application. the text matter is being POSTed properly, but i am not able to upload any files using filemanager(audio/video/zip), delete/rename any manually saved files. also i am not able to create new subdirectories using the filemanager.

i am getting the error that "PERMISSION DENIED" my httpd service is running with user/group as apache/apache uid=48 and the ownership of the htdocs is also with apache:apache with permissions 0777 the OS i am using is fedora core 6. I even tried the same using another editor (FCKeditor), but still it gives the same problem.

View Replies !
Use Virtual Hosts To Develop Locally But Upload Throws Error In Source File References
On my development computer, I have virtual named host set up, like
www.site1.lab.

When I upload those to my web site for customer review under
mywebsite.com/clients/site1/
it throws some of the source file references off and it does not work
properly.

My references are like:
require_once($_SERVER['DOCUMENT_ROOT']."/utility/top.php");

Obviously those will not work since $_SERVER['DOCUMENT_ROOT'] references
mywebsite.com.

Is there anything I can do in apache.conf for a virtual directory that would
make it so when I upload a site for customer review, I don't have to change
the source references?

View Replies !
File Upload - Nothing In The $_FILES Array After Selecting A File And Clicking Submit
I have to following HTML form to upload a file:

<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
<input name="userfile[]" type="file" />
<input type="submit" value="Submit" />
</form>

In my upload script I have:

if(is_uploaded_file($_FILES['userfile']['tmp_name']))
{
..do some code, etc.
}

There seems to be nothing in the $_FILES array after selecting a file and clicking submit. Any ideas why? All I get is this when trying to echo some of the $_FILES variables: File Array is Array bytes, i.e. the word Array is just being printed instead of the relevant info.

View Replies !
Upload A File And Have  Alink Of The File Displayed On The Webpage.
I want to upload a file and have  alink of the file displayed on the webpage.

q)Now I can do an image but is there anything else i need to know? eg fileupload and store on a dir and have a link to the file in  mysql. The file would be .txt ot .doc etc

q)Is there a way to upload  a lot of text eg 2000 words to a webpage and have the content displayed on a webpage ?

View Replies !
File Upload Fails - Different Files And Sizes And The Time Required Seems To Be Proportional To File Size,
I'm using IE5.5 as client and php4 on linux/apache as server. I've followed the examples for doing a file upload from a form and everything appears to work from the client side. In my script I see the following values:

UploadedFile=none
UploadedFile_name=test.html
UploadedFile_type=text/html
UploadedFile_size=0

I've tried different files and sizes and the time required seems to be proportional to file size, so I think there is a file being sent by the browser. The UploadedFile_name and type reflect the file being sent. Since I'm not getting a name for the temporary file in UploadedFile (if it was in fact created) and size = 0, I can't move or copy it. Code:

View Replies !
Email With File Attachements - How To Upload File To Server From Browser?
I have a PHP script that sends an email with attachment and works great when
provided the path to the file to send.

However this file needs to be on the same server as the script.

I want to develop a webpage where people can send attachments that are
stored on their local PC.

I know I can use the <input type="file" > HTML to generate a file box that
allows the user to navigate to a file on their PC and product a file path,
but how do I then upload this file onto file server to email out with my PHP
email script?

Is there an easy way to do this?

Or can I approach this problem from a completely different angle.

View Replies !
Upload File Error 3: "The Uploaded File Was Only Partially Uploaded"
I've a file that starts like this:

<form id="pdsForm" method="post" action="/mcControlPanel.php"
class="mcForm" charset="UTF-8" enctype="multipart/form-data" >

and it contains this input:

<input id="biopic" name="biopic" type="file" />

The script recieving it does this:

$biopic = $this->core->getVar("biopic");
if (is_array($biopic)) {
print_r($biopic);

I get:

Array ( [name] =L-monkeySmall.jpg [type] =[tmp_name] =[error] =>
3 [size] =0 )

Error 3 is "Array ( [name] =L-monkeySmall.jpg [type] =[tmp_name]
=[error] =3 [size] =0 )". As you can see, 0 kilobytes were
uploaded.

What should I look for? I've been looking on the web for awhile and so
far I've found little useful information about what Error 3 typically
indicates.

View Replies !
File Upload Warning: Max File Size Exceeded
I have 2 files, one is a HTML file with the code to create a Browae and Submit Button for uploading a file. (This works fine). BUT, when I click the submit button, I want the file to upload to a directory on my C:/ drive which I have indiciated in the PHTML file, but I keep getting the following error and I don't know why.

Warning: Unable to open 'php2' for reading: Unknown error in C:apachehtdocs/submitassprac.phtml on line 5 Couldn't copy the file! OR

Warning: Max file size exceeded - file [img1] not saved in C:apachehtdocs/submitassprac.phtml on line 0 Code:

View Replies !
File Upload :: Warning: Fopen - No Such File Or Directory
I’m getting the following errors when I try to run the script below on a live server. It’s a crude script which uploads text and images directly into MySQL. It works fine on my local machine, I have Apache, PHP4 and MySQL running on windows. The live server is Unix.

When I try to upload images from my loacal pc I get the error below, when I placed an image file within the same directory as the script on the live server and tried to upload it that worked. I wanted the script to allow image uplload from a client pc Can anyone offer a suggestion?

Warning: fopen("C:Apachehtdocs Grey.jpg", "r") - No such file or directory in /usr/local/home/httpd/vhtdocs/sitehostin/moondance/backend/test_imagedb.php on line 57
Code:

View Replies !
File Upload Script - Testing For Existence Of File
i'm having a strange problem when processing some form data. I just want to validate that required fields have been populated, then, if an image has been uploaded, i want to ensure that a description of the image has been provided (for alt tag purposes) before processing the data.

For some reason, when a file hasn't been attached, my script interprets it otherwise and prompts the user for the alt tag. I've not come across this problem before, there's a good chance i've done something idiotic but i just can't see it Code:

View Replies !
File Upload :: 'wrong File Type' On Another Server
doing a simple image (jpeg) upload to a directory. Have a script which works fine on one server but comes up with 'wrong file type' on another server. The server that works has php5 installed, the other is 4.2.2 but I am sure what I have should work on both.

PHP Code: ......

View Replies !
File Upload NOT Using HTML Input Type=file
in an earlier post on the javascript forum i was talking about a small program i'm writing to allow file uploads through the http protocol that look and function similar to a ftp client.

I have made some nice progress on this project and am able to return the FSO collection from the client pc. this allows me to list of directories on the page so users can select multiple files to upload at once or even entire directories. Code:

View Replies !
File Upload, Set Defalut File Name, Hide Form
I found and used a number of handy tutorials on PHP/MySQL/HTML file upload. I have a working model. What I would REALLY LIKE is to find a way to establish a default file name and location for that upload and HIDE the html form.

That, or a short and sweet line of code that simply post the file from it's location to the table/row/coulmn of my choice.

View Replies !
File Upload - Any Way To Get The Path Of The File On Users Computer?
Producing a html form with file upload. I am working on the error checking and when the page is submited, if their is errors on it I want the pathname of the image to remain in the html file box, so the user does not have to re-select it.

ie html form:

<input name="pictures[]" type="file" size="30">

I know you can get the name via

$_FILES['userfile']['name']


but is their any way to get the full path name?

I though PHP Code:

$_POST['pictures'][0]

ect might work but it doesnt.

View Replies !
Upload Error - Upload A Thum_anne.jpg From Images Folder
I have created a folder call 'uploads' inside of add_record folder:www/charlton/icccon/add_record/uploads directory, would like to upload a thum_anne.jpg from images folder where is www/charlton/icccon/member/images diretory,

but it failed and found the warning sentence below, I don't have much hairs before this problem, and has a quite few less now, can you please help me to solve this problem? Code:

View Replies !
File Upload - Directory Is Writable, File Is Not
I'm writing a script to upload images along with articles to a
directory on the server. I'm developing it offline on my WinXP and
Apache 1.3.x laptop and it's working great, but when I move the script
to the server, I get write errors when the file attempts to upload.

So I set up a test script (included below) to test the directory
structures all the way up to the file, and every directory appears to
be writable, yet I can't write to the test file. I keep seeing
suggestions to set the open_basedir directive in the php.ini file to
solve this, but it's hasn't worked yet. Can anyone suggest what I can
try to get the uploads working?

<?php

$filename = 'images/articles/test.txt'
$somecontent = "Add this to the file";

......

View Replies !
File Upload Handling (file Types Etc.)
I have two questions. First, how can I control what files a user uploads? I can, of course, check the extensions but they can't always be trusted. Can I check the mime-types somehow? Second, is there a way I can set the "available formats" in the file upload dialog box?

View Replies !
File Upload Bigger File Size
i can upload small files. however i cannot upload bigger files-but max_file_size is set correctly. what can be wrong? is it connected witrh my browser?

View Replies !
File Upload Works But Only For Empty File
I can upload a file as long as it is empty (thanks Hendri Kurniawan).
I do not know where to look.

Can someone help me understand what I need to do to upload a small image.
http://chops.novatrope.com/game/test/upload_file3.php

Here is some more info http://chops.novatrope.com/info.php

View Replies !
I Can Not Get File Uploads To Show Up When I Upload A File
I've a form that starts off like this:

<form method="post" action="profile.php?
id=5&formName=my_story_edit.htm" enctype="multipart/form-data">

<p>Email address:<br />
<input type="text" name="totalFormInputs[users][5][email_address]"
value="lawrence@krubner.com" /></p>

<p>Zip code:<br />
<input type="text" name="totalFormInputs[users][5][zip_code]"
value="22902" /></p>

<p>Personal image:<br />
<input type="file" name="totalFormInputs[users][5][upload_file]" /></
p>

Oddly enough, the "upload_file" has suddenly disappeared from the
uploaded array. When I hit $totalFormInputs with print_r, this is what
I get:

Array
(
[users] =Array
(
[5] =Array
(
[description] =I grew up in New Jersey.
[email_address] =lawrence@krubner.com
[zip_code] =22902
[time] =1187380627
)

)

)

View Replies !
File Upload Cannot Open The File It May Be Corrupted
I'm really stuck with the file upload. I submitted similar code a while ago in MSSQL section , but didnt get any reply at all so i've change the code but am still having problems. Some one please help.

I'm running PHP 4.4, IIS 5.1 and mssql

Ok, i'm uploading a PDF file to a directory, the upload works fine but when I download the file I get an eror "cannot open the file it may be corrupted". It really bugging me, I cannot figure out why its not working. the PDF files that I upload are fine but when I upload it I cant open them again. Code:

View Replies !
Display File Type Of Upload File
How do I display the file type of an uploaded file, in order to find out what mime type to use?

View Replies !
File Upload Form With A File Field
I have a form with a file field and i want the value of the field to be set to what is selected from the database to be displayed. Code:

View Replies !
Upload File And Save The File Into One Of Folder
I'm trying to solve problme with upload file, one this scripts is to uplaod file, is works great but something missing myself that the file is missing not sure where they save to. I just need help where to write code to save the file into one of folder in C drive. Code:

View Replies !
Multiple File Upload With JAR File = Inconsistent
I’m doing a multiple file (JPEG, ZIP, JAVA JAR) upload via an HTML form and in some cases the JAR file refuses to upload (The JPEG and ZIP have no problem). I do extensive file testing in the PHP code (below), but no error is returned. Code:

View Replies !
File Upload File Size Limit
I am uploading a text file to the server which is 3.79mb approx. And for some reason I am unable to upload, however if I reduce the size of the file to 1.79mb approx then the upload works ok.

If anyone has any ideas as to why this is then I would appreciate it, otherwise I will have to consider multiple uploads.

View Replies !
File Upload - Storing The File Causes A Problem.
I have the following code to handle file uploads. There is a database
called "media". The errors I keep getting will follow the code. The
upload data gets into the database fine; it seems to be storing the
file that causes a problem. Code:

View Replies !
File Upload Question - File Does Not Appear Where It Is Supposed To
I used the following test files to test the file upload. It works fine except that the file does not appear where it is supposed to. In fact, it does not appear anywhere accessible! It ends up in /tmp/some_random_name. When I check the directory /tmp no such file or folder exists!

Since this is a site hosted by an outside hosting company, I cannot modify the php.ini file, as directed in the php manual to change the temp_dir (if this is what I need to do). This is what I have and the output: Code:

View Replies !
Multiple File Upload From Client Pc To Server Without Using <input Type="file"> Cont
I am working on a application which requires me to upload the contents of all the files from a particular folder in clent pc to the server.

In my code i just want to mention the folder name which may contain any number of files.Folder name will always be fixed.
I dont want to use <input type=file > control.

Is there any way i can achieve this using FTP or any other way in PHP.Any help will be greatly appreciated.

View Replies !
File Upload :: Get The Name Of Uploaded File
Hi all, this might be more of an html question but I think it can be done in
PHP, so I will ask here.

I have an html form that allows for .pdf file uploads. This script will
serve two functions 1) upload a .pdf file to a specific directory on the web
server and 2) create an entry into the db that includes the name of the file
just uploaded. I want to have another web page that will dynamically list
all of the names of the files uploaded as clickable hyperlinks so they can
view those .pdf files.

I have the file upload code working just fine, but the name that gets
written to the database as something like: "/tmp/phpTg2toF", which is not
the name of the file. How can I "get" the name of the file that I upload so
that it can be written into the db as a file name? Anyone have ideas? Thanks
in advance. Here is my code:

View Replies !
File Upload :: No Such File Or Directory In ..
I'm currently trying to get a file upload form to work, the original I started with came from this sites tutorial.. No matter what I tries, I gets messages like "Warning: Unable to create '/images/': No such file or directory in /Users/victor/Sites/foto/upfile.php on line 33"

/images has 777 properties. The form code is:

View Replies !
File Upload :: Mpeg File
I'm trying to upload an mpeg file to a folder created on a server running Apache. I have tested this code on my machine which has w2k and php 4 installed and it works fine. But when I try and run this on the server running Apache I get the following error:

Warning: Unable to create '/data/htdocs/elders/listing_vids/12445.mpeg': Permission denied in /data/htdocs/elders/branch/admin/realimage_man/do_upload.php on line 32
Can't copy breakdance3.mpeg to 12445.mpeg

Would anyone know what the problem is?

View Replies !
Upload File Gives A Blank File Name
I am having trouble with an upload script. Searched the forum but still couldn't fix it.
Here is the code: PHP Code:

View Replies !
File Upload :: File Not Moved
The following code is supposed to upload a file to a directory on my local testing server called "upload_directory". It get's it's info from a simple file upload form. It echoes to the screen that "File was moved!" but when I check if it has been moved, it hasn't. Any ideas? Code:

View Replies !
File Upload Not Telling Me The File Name
ok. so i am comming along. Now i have this version of the script. and the problem is that it isn't telling me the file name


<html>
<body>
<?php
//Include the pages needed for this to work and upload place
include ('db.php');
include ('functions.php');
include ('fileupload-class.php');
$file = 'uploads/'
$path = 'uploads/'
//Get the needed info
$filename = $_FILES['userfile'];
$des = $_POST['description'];
$sdate = date("m/d/y g:i:s");
$ip = getip();
$upload_file_name = file['name'];
//Run some small file checks
$filename = stripslashes($filename);
$filename = str_replace("'","",$filename);
#--------------------------------------------#
#--Any Extra options i feel like including---#
#--------------------------------------------#
// MODE: if your are attempting to upload
// a file with the same name as another file in the
// $path directory
//
// OPTIONS:
//   1 = overwrite mode
//   2 = create new with incremental extention
//   3 = do nothing if exists, highest protection
    $mode = 2;
// UPLOAD the file
#-----------------------------------------------#
#--Well lets not forget the $my uploader stuff--#
#-----------------------------------------------#
// Create a new instance of the class
        $my_uploader = new uploader($_POST['language']); // for error messages in french, try: uploader('fr');
        $my_uploader->max_filesize(900000);
#-----------------------------------------------#
#-----------Drum Roll Please--------------------#
#--------ITS TIME TO UPLOAD!!!!!!---------------#
#-----------------------------------------------#
        if ($my_uploader->upload($upload_file_name)) {
            $my_uploader->save_file($path, $mode);
        }
        
        if ($my_uploader->error) {
            echo $my_uploader->error . "<br><br>";
    } else {
            // Successful upload!
    $name = $my_uploader->file['name'];
    $ext = Get_Extension_From_File($name);
$msg = fe_is_delete("uploads/$name.$ext");
    rename("uploads/" . $name, "uploads/" . $name . ".$ext");
        mysql_query("INSERT INTO `snpvc` (`filename`, `description`, `datetime`, `ip`, `review`) VALUES ('$name','$des','$sdate','$ip','no')") or die ("MySQL error: " . mysql_error());       
        print("Saved Game Successfully Uploaded!<br><br>");
            // Print all the array details...
            //print_r($my_uploader->file);
}
echo 'Here is some more debugging info:'
print_r($_FILES);
echo "<p><p>";
echo "<br>The File Name is: $my_uploader_file";
echo "<br>Your IP is: $ip";
echo "<br>The date is: $sdate";
print "</pre>";
?>
<a href="index.php">Home</a> | <a href="uploader.php">Upload Another</a> | <a href="view.php">View Uploaded</a>
</body>
</html>

View Replies !
File Upload And View File
I upload files to a folder on the server or into a database and then allow the user to view all files via a webpage.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved