Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
paranor
Worker
Worker



Joined: Aug 28, 2003
Posts: 227

PostPosted: Mon Sep 29, 2003 10:38 am Reply with quote

Hi.

I'm creating the user documentation for using the coppermine photo gallery and I'm wondering if there is a module I can't find that allows uploading of files to a specific directory?

I played with the Documents module but that doesn't feature upload option yet.

thanks
 
View user's profile Send private message
TheosEleos
Life Cycles Becoming CPU Cycles



Joined: Sep 18, 2003
Posts: 960
Location: Missouri

PostPosted: Mon Sep 29, 2003 11:29 am Reply with quote

Here is a site that has one. I have not used the version 2.0 yet because it costs $5.00 for it. I probably will because so far I really like the other scripts they have made. I really want to be able to do what you are talking about so I think the money will be worth it. I am trying an older version of their download script and I really like it. It just does not have an upload option like their new one. Go to their downloads section to see how it works. Nukecops was supposed to make one but I have not heard anything.

http://www.nukestyles.com/index.php

The site is moving slow today.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website AIM Address ICQ Number
paranor







PostPosted: Mon Sep 29, 2003 1:57 pm Reply with quote

Thanks. I thought it was a download only enhancement. I NEED TO READ THE DETAILS. Smile

I'm trying to avoid having to use FTP to get the pictures up to the web server and limit that ability to one user ID (admin type).

I shot him an email to get clarification on a few questions I had.

thanks again!
 
TheosEleos







PostPosted: Mon Sep 29, 2003 2:04 pm Reply with quote

Let me know what you find out. I am very interested as well.
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Sep 29, 2003 4:22 pm Reply with quote

Have you checked at hotscripts.com? They have many to offer. I don't use them myself since I prefer to set up ftp accounts, so I can't comment on them.
 
View user's profile Send private message
afc
Worker
Worker



Joined: Aug 16, 2003
Posts: 107
Location: USA

PostPosted: Mon Sep 29, 2003 8:32 pm Reply with quote

Code:
<?

$sizelimit = "no"; //Do you want a size limit, yes or no?
$sizebytes = "10600000"; //size limit in bytes
$dl = "http://www.yoursite/"; //url where files are uploaded
$absolute_path = "/direct path/"; //Absolute path to where files are uploaded
$websiteurl = "http://www.yoursite/"; //Url to you website
$websitename = "***";

switch($action) {
default:
echo"
<html>
<head>
<title>Upload Or Download</title>
</head>
<BODY BGCOLOR='#000000' TEXT='#FFFFFF' LINK='#00FE00' ALINK='#00FE00' VLINK='#00FE00'>
 <a href=$PHP_SELF?action=upload>Upload File</a>
 <a href=$PHP_SELF?action=download>Download File</a>
 <a href=$websiteurl>Return to $websitename</a>
<br><br>
Powered by <a href=http://yoursite/>yoursite Online Upload/Download Script</a>
</body>
</html>";
break;
case "download":
echo "
<html>
<head>
<title>File Download</title>
</head>
<BODY BGCOLOR='#000000' TEXT='#FFFFFF' LINK='#00FE00' ALINK='#00FE00' VLINK='#00FE00'>
<a href=$PHP_SELF?action=upload>Upload File</a> <a href=$websiteurl>Return to $websitename</a>";
$list = "<table width=700 border=1 bordercolor=#FFFFFF style=\"border-collapse: collapse\">";
$list .= "<tr><td width=700><center><b>Click To Download</b></center></td></tr>";
$dir = opendir($absolute_path);
while($file = readdir($dir)) {
if (($file != "..") and ($file != ".")) {
$list .= "<tr><td width=700><center><a href=$dl/$file>$file</a></center></td></tr>";
}
}
$list .= "</table>";
echo $list;
echo"
<br><br>
Powered by <a href=http://yoursite>yoursite Online Upload/ Download Script</a>
</body>
</html>";
break;

case "upload":
echo"
<html>

<head>
<title>File Upload</title>
</head>

<BODY BGCOLOR='#000000' TEXT='#FFFFFF' LINK='#00FE00' ALINK='#00FE00' VLINK='#00FE00'>

<form method=POST action=$PHP_SELF?action=doupload enctype=multipart/form-data>
<p>File to upload:  No spaces in file names or people can't download it before it posted on the main page<br>
<input type=file name=file size=30>
<p><button name=submit type=submit>
Upload
</button>
</form>
<br><br>
Powered by <a href=http://yoursite/>yoursite Online Upload/ Download Script</a>
</body>

</html>";
break;


//File Upload
case "doupload":
$dir = "dir";
if ($file != "") {

if (file_exists("$absolute_path/$file_name")) {
die("File already exists");
}

if (($sizelimit == "yes") && ($file_size > $sizebytes)) {
die("File is to big. It must be $sizebytes bytes or less.");
}


@copy($file, "$absolute_path/$file_name") or die("The file you are trying to upload couldn't be copied to the server");

} else {
die("Must select file to upload");
}
echo "
<html>
<head>
<title>File Uploaded</title>
</head>
<BODY BGCOLOR='#000000' TEXT='#FFFFFF' LINK='#00FE00' ALINK='#00FE00' VLINK='#00FE00'>";
echo $file_name." was uploaded";
echo "<br>
<a href=$PHP_SELF?action=upload>Upload Another File</a>
<a href=$PHP_SELF?action=download> Download File</a>
<a href=$websiteurl> Return to $websitename</a><br><br>
Powered by <a href=http://yoursite/>yoursite Online Upload/ Download Script</a>
</body>
</html>";
break;

}
?>


Last edited by afc on Tue Sep 30, 2003 6:08 pm; edited 1 time in total 
View user's profile Send private message
Raven







PostPosted: Mon Sep 29, 2003 8:37 pm Reply with quote

Maybe it's in here and I missed it, or maybe you trap it some other way, but what stops me from uploading a .php file with malicious code in it and pointing my browser to it to execute the code? You normally only want certain filetypes available for upload. I could send a .php file with an exec statement in it and wipe your disc otherwise.
 
TheosEleos







PostPosted: Tue Sep 30, 2003 11:13 am Reply with quote

That is a scarry thought.
 
paranor







PostPosted: Wed Oct 01, 2003 10:27 pm Reply with quote

good point.

and if you onliy allow certain extensions can't I upload it as a .jpg and still execute as a .jpg extension? Does the php engine look at the extension or the code and doesn't care about the extension?

And I'll try your code for testing - thanks!
 
paranor







PostPosted: Wed Oct 01, 2003 10:35 pm Reply with quote

doh!

found this a few minutes later...

http://trainsim.condor-edv.com/nuke-upload/index.html

It's getting late - I'll play with that tomorrow.

You know what would be nice? A centralized location of all php-nuke mods. ARGH!
 
paranor







PostPosted: Wed Oct 01, 2003 10:42 pm Reply with quote

Ok - now this is funny.

Notice who posted this on nukecops?

http://www.nukecops.com/article462.html

lol
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©