0

i have created a file uploading system on a website that i have created and i need to know how the file can be over written.

the file thats are upload are only used once and the next time the user uploads a new file i want the last file to be over written. the code i am using to name the file on the server is this.

$image_name=image1.'.'.$extension;

i no some a if statement will have to be placed in but when i tried to code it it stopped the upload working. i was using a unix time stamp at first but if i name the image it makes it easier for the image to be used in other sections of the site and for email purposes.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by kevin wood
-1

i am using something like this

<?	if (isset($_FILES['uploadingfile']['tmp_name'])) {
		$originalpath="http://www.wesite.com/".$_FILES['uploadingfile']['name'];
		if (!file_exists($uploaddir)) {
		  mkdir($uploaddir,0777);
		}  
		if(is_uploaded_file($_FILES['uploadingfile']['tmp_name']))
		{
		move_uploaded_file($_FILES['uploadingfile']['tmp_name'],.$_FILES['uploadingfile']['name']);
		}
		//update query
	}

?>
<form name="frmresumeupload" enctype="multipart/form-data" method="POST">
File: <input type="file" name="uploadingfile" size="30"> <br />
<input type="submit" value="Upload!">
</form>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.