Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Uploading Files, php Vs Ftp Server uploading files?< Next Oldest | Next Newest >
jnymris Offline





Group: Members
Posts: 16
Joined: April 2007
Posted: June 08 2007,21:38 QUOTE

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


--------------

First impression of DSL: THE BEST
Second impression: pretty hard to work :(
Back to top
Profile PM WEB AOL MSN 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: June 08 2007,22:04 QUOTE

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?


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
jnymris Offline





Group: Members
Posts: 16
Joined: April 2007
Posted: June 08 2007,22:07 QUOTE

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.


--------------

First impression of DSL: THE BEST
Second impression: pretty hard to work :(
Back to top
Profile PM WEB AOL MSN 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: June 08 2007,23:26 QUOTE

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?
Back to top
Profile PM 
jnymris Offline





Group: Members
Posts: 16
Joined: April 2007
Posted: June 09 2007,07:08 QUOTE

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?


--------------

First impression of DSL: THE BEST
Second impression: pretty hard to work :(
Back to top
Profile PM WEB AOL MSN 
9 replies since June 08 2007,21:38 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: Uploading Files

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code