•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 456,468 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,780 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 JSP advertiser: Lunarpages JSP Web Hosting
Views: 1406 | Replies: 1
![]() |
You would create that segment of the form and then in the script which processes the date you need to have a variable which defines the target path.
Something like this for the form component:
And then depending on what you are using to process that field you will need to specify the path and I recommend validating to make sure they can't upload certain extensions like executable which will destroy your database.
Something like this for the form component:
<input type="hidden" name="userfilename" id="userfilename"> <span class="input_title">Choose a file to upload:</span> <input name="uploadedfile" type="file" />
And then depending on what you are using to process that field you will need to specify the path and I recommend validating to make sure they can't upload certain extensions like executable which will destroy your database.
//$target_path = "uploads/";
// Where the file is going to be placed
$target_path = 'C:/websites/uploads/'.$_FILES['uploadedfile']['name'];
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
//echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} else{
echo "There was an error uploading the file";
print_r($_FILES);
}![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- filesize check before upload (JavaScript / DHTML / AJAX)
- Competent web designer wanted (Computer Science and Software Design)
- upload files hlp (PHP)
- Upload a Directory with its Files and subfloders (ASP.NET)
- When Users Upload *.txt file, i will get Total Points ,Points Per Game ,etc... (PHP)
- Do you know what I need for this to Validate (PHP)
- Need file upload code for word Doc (HTML and CSS)
- uploading a picture (PHP)
Other Threads in the JSP Forum
- Previous Thread: JSP Problem
- Next Thread: how to get (from URL) & then set parameter....


Linear Mode