Other Help Topics :: Uploading Files



I have created a way i can upload files using php but i cannot upload the files because of the security settings the folder i'm trying to upload it to is opt/lampp/etc so it's a system folder i believe i cann't change that so anyone can edit these files.

I've though about installing a ftp server on dsl so i could transfer files across from windows to dsl (my coding computer) but again i cannot install any ftp server due to my lack of knowledge it would be great if someone could help me out with either of the two.

Cheers in advance,
-Jny

Can you change what directory is used for uploads? It seems to me that an etc directory would be a bad thing to make writable for all.

What type of application is lampp? a uci?

lampp is just xampp for linux, install it and you can run php scipts, sql database etcs on your linux box.

I can since i'm using the code
Code Sample
<?php
if ($_FILES["file"]["size"] < 200000000))
 {
 if ($_FILES["file"]["error"] > 0)
   {
   echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
   }
 else
   {
   echo "Upload: " . $_FILES["file"]["name"] . "<br />";
   echo "Type: " . $_FILES["file"]["type"] . "<br />";
   echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
   echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";

   if (file_exists("upload/" . $_FILES["file"]["name"]))
     {
     echo $_FILES["file"]["name"] . " already exists. ";
     }
   else
     {
     move_uploaded_file($_FILES["file"]["tmp_name"],
     "upload/" . $_FILES["file"]["name"]);
     echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
     }
   }
 }
else
 {
 echo "Invalid file";
 }
?>

But this is where i want the code to be, where would i upload it too? which would be able to be uploaded? if i can get it onto my dsl pc then i can move it i surpose although i'd rather a direct uplaod their.

mikshaw isn't asking about what the application does, but rather what kind of mydsl extension you loaded.

What do you mean by "this is where i want the code to be"?  First, make sure that upload/ directory exists and is writeable.  If you're not sure, just try /tmp instead.

As for a ftpd, I believe betaftpd is included in the base DSL image, unless you were thinking of another package?

I have managed to get it running but id unno wht the username and password's are?

where would the files go to? what location on linux? could i change the location? so when i upload them they will automatically go to the correct location?

Next Page...
original here.