I have a standard multipart/enc form to allow users to upload files.
Pseudocode:
//call function to insert file details into the database
if( NOT file upload attack, wrong file type, etc.){
//copy the file to the permanaent location
}
else{
//delete the record of file
I have an admin site where users can upload files. Information about the
file like file name and song name are stored in a Mysql db.
Here's a snippet of code:
//add the MP3 meta data to the database
$mp3ID=addMP3($songName,$isStudio,$HTTP_POST_FILES['userfile']['name'],$user
Based on my experience, I see about 90% of hits during the week (as you
said). 80% of the daily hits occur during a 10 hour period during the day.
At 600k pages/month, that's about 13 pages per second average, during the
day. Since hits aren't evenly distrubuted, you can plan on about 2 to 3
Based on my experience, I see about 90% of hits during the week (as you
said). 80% of the daily hits occur during a 10 hour period during the day.
At 600k pages/month, that's about 13 pages per second average, during the
day. Since hits aren't evenly distrubuted, you can plan on about 2 to 3
Why don't you just do the sql insert *after* the file upload function?:
Pseudocode:
if( NOT file upload attack, wrong file type, etc.){
//copy the file to the permanaent location
//call function to insert file details into the database
}
else{
//echo error to user
I thought I had a solution for you until I read the documentation saying
that mysql_db_query() is now deprectiated. This is a concern since we have
been using the mysql_db_query() function (and still use with v.4.1.2) on our
site. This function works as following:
// Connect to dbs