PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
paranor
Worker
Worker


Joined: Aug 28, 2003
Posts: 227

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

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 Back to top

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.
Only registered users can see links on this board!
Get registered or login to the forums!


The site is moving slow today.
View user's profile Send private message Visit poster's website AIM Address ICQ Number
paranor
Worker
Worker


Joined: Aug 28, 2003
Posts: 227

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

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!
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 2:04 pm Reply with quote Back to top

Let me know what you find out. I am very interested as well.
View user's profile Send private message Visit poster's website AIM Address ICQ Number
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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 Visit poster's website AIM Address Yahoo Messenger
afc
Worker
Worker


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

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

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 Yahoo Messenger MSN Messenger ICQ Number
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
TheosEleos
Life Cycles Becoming CPU Cycles


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

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

That is a scarry thought.
View user's profile Send private message Visit poster's website AIM Address ICQ Number
paranor
Worker
Worker


Joined: Aug 28, 2003
Posts: 227

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

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!
View user's profile Send private message
paranor
Worker
Worker


Joined: Aug 28, 2003
Posts: 227

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

doh!

found this a few minutes later...
Only registered users can see links on this board!
Get registered or login to the forums!


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!
View user's profile Send private message
paranor
Worker
Worker


Joined: Aug 28, 2003
Posts: 227

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

Ok - now this is funny.

Notice who posted this on nukecops?
Only registered users can see links on this board!
Get registered or login to the forums!


lol
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum