Re: File Uploads Help!!! --Forgot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here is the output I am printing:

'tempUploads/1425182872.xlsUploaded The File.'

What is the issue?

-Jason


On Dec 5, 2008, at 2:11 PM, Jason Todd Slack-Moehrle wrote:

Hi All,

I am uploading a file and it says it worked, but I dont see it in the directory

Here is my code so far:
	
	$allowed_ext = array('csv','xls');
	$ext = end(explode('.',$_FILES['uploadedfile']['name']));
	$ran2 = rand().".";
	$target = "tempUploads/";
	$target = $target . $ran2.$ext;
	
	if($_FILES['uploadedfile']['size'] > 2000000){
		$message = 'File over 2MB';
		echo $message;
		exit;
	}
	
	if($message == NULL && !in_array($ext,$allowed_ext)){
		$message = 'File extension not allowed'.' extension is:'.$ext;
		echo $message;
		exit;
	}
	
	if($message == NULL) {
		if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target))
		{
			$message = "Uploaded The File.";
			echo $message;
			
			// upload was successful, now lets work with it
			include '_functions.inc'; // Utility Functions

include '_fileHeaders.inc'; // CSV File Headers that we expect, in the proper order
			
			include '_fileParse.inc'; // CSV File Parsing
		}
		else
		{
			$message = "Sorry, there was a problem uploading your file.";
			echo $message;
		}
	}

How can I verify it is there? I ftp in and I dont see it.

-Jason


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux