PHP upload script help!!!!!!!!!?
-
I'm making a file hosting site. my upload script is good, but one problem: if a file is uploaded, and an already uploaded file has the same name, the older file gets overwritten. Could I make it so it will return an error and not let you upload it? my upload from (html) <form enctype="multipart/form-data" action="upload.php" method="POST"> Please choose a file: <input name="uploaded" type="file" /> <input type="submit" value="Upload" /> </form> my php script <?php $target = "upload/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; if(move_uploaded_file($_FILES['uploaded'… $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded. "; echo "your url is tylersfiles.netne.net/fileup/upload/(you… ". basename( $_FILES['uploadedfile']['name']). " ."; } else { echo "Sorry, there was a problem uploading your file."; } ?> <html> <FORM> <INPUT TYPE="BUTTON" VALUE="Home Page" ONCLICK="window.location.href='http://ty… </FORM>
-
Answer:
Tyler at Yahoo! Answers Visit the source
Other answers
Marked this for later viewing.
tedead
Related Q & A:
- What is the simplest ajax upload plugin or script to be used with wordpress?Best solution by WordPress
- How to upload a file to another server using cURL and PHP?Best solution by Stack Overflow
- How to upload file using ajax php?Best solution by Stack Overflow
- How to start creating a php script, that will be installed on many servers?Best solution by Stack Overflow
- Mouseover script help?
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.