Jump to content

alsouno

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

alsouno's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It's still displaying the same message :-\
  2. The echo output is as follows: Trying to move C:\WINDOWS\TEMP\php78.tmp to test.htmlCouldn't move file
  3. Sorry for being lazy and not realizing the missing closing bracket myself :-\ Anyways, using your code, I still get "Couldn't move file"...
  4. That code doesn't seem to work...
  5. Using your code, I get the following: "Couldn't move file"...
  6. Yep. I just have a simple form setup that passes through the data to this page... The body of that page contains: Thanks
  7. I created a test case which has the following code: [pre] <?php $host="****"; // Host name $username="****"; // Mysql username $password="****"; // Mysql password $db_name="****"; // Database name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); //upload file $target = "images/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; $filename = "./".basename( $_FILES['uploaded']['name']) ; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Upload TEST</title> </head> <body> <br/> test... </body> [/pre] and it gives the "sorry there was a problem uploading your file" message... i tried displaying a table from my db on the page and it works fine but i can't seem to upload onto my ftp.
  8. We had a comprehensive uploading feature based on PHP for our website, but since we recently changed servers it seems to be giving us problems. I've looked into the permission settings, etc and everything seems intact, but i am still not able to upload files. Not sure if posting code will necessarily make a difference, but I can if needed. Has anyone had similar issues, or aware of what might be the cause? Any insight would be greatly appreciated
  9. wow that worked! thanks. could you explain the logic behind that, if its not too much trouble, so that i can avoid making the same mistake in the future? thanks againnnn
  10. hi, i'm working on a website where users can upload csv files and have it converted directly to a specific table in the sql db... it was working fine at first, but now it seems to give me the following error: Warning: file(./test.csv): failed to open stream: No such file or directory in ... once the file (in this case test.csv) is selected to upload, the form sends it to a page called upload.php i'm relatively new to php as im more experienced with jsp so my coding may not be the most efficient or the prettiest ... but anyways, here is some relevant code from upload.php: //upload file $target = "docs/"; $target = $target . basename( $_FILES['uploaded']['name']) ; $ok=1; $filename = "./".basename( $_FILES['uploaded']['name']) ; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } //add values to table $fcontents = file ($filename); for($i=0; $i<sizeof($fcontents); $i++) { $line = trim($fcontents[$i]); $arr = explode(",", $line); $sql = "insert into portfolio values ('". implode("','", $arr) ."')"; mysql_query($sql); echo $sql ."<br>"; if(mysql_error()) { echo mysql_error(); } } any help would be appreciated! Cheers
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.