php forum
php mysql forum
php mysql smarty
 
Page 7 of 9 < 1 2 3 4 5 6 7 8 9 >
Topic Options
#134094 - 07/06/01 08:38 PM Re: [6.0x] ELY_M's Upload Modification
Troy Offline
Member / MultiHacker

Registered: 04/16/01
Posts: 294
WDFA, I have the same "problem" with my web host. It isn't a problem with the hack instructions. Most servers will run a CGI at 777. However some(like yours and mine) have to be at 755. I am not sure exactly what it is as I do not run web hosting services, but I assume it is either a configuration setting or a misconfiguration by our web hosts.
_________________________
Troy Jones
Author of MultiHack & UBBStyles
EMAIL: troy@nomadsoft.net
WEB: http://www.nomadsoft.net

Top
#134095 - 07/10/01 05:15 PM Re: [6.0x] ELY_M's Upload Modification
Dave_L Offline
Member

Registered: 08/16/00
Posts: 356
Loc: Virginia, USA
Re: corrupted files

On non-Unix/Linux platforms, you should use binmode for reading/writing binary files:

Code:
code:


It's ok to use binmode on Unix platforms too. It's unnecessary, but doesn't hurt anything.

<FONT COLOR="#000000" SIZE="1">[ July 10, 2001 05:26 PM: Message edited by: Dave_L ]</font>

Top
#134096 - 07/12/01 01:03 PM Re: [6.0x] ELY_M's Upload Modification
Alex Carr Offline
Junior Member

Registered: 06/22/01
Posts: 6
Thanks dave_L!!

Top
#134097 - 07/12/01 06:39 PM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
Yup, that definantly works. Thanks Dave! That should be added cause I am sure there are a fair amount of windows users out there.

Top
#134098 - 07/12/01 06:41 PM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
BTW if you could just add a number like the others suggested (image.jpg, image2.jpg etc) it would be alot better than random file names. Thanks!

Top
#134099 - 07/13/01 03:50 PM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
Hmmmm I decided to try and do it myself. If anyone has suggestions let me know. I know very little perl smirk

Code:
code:


This is where he is generating a random file name. What I ideally want is for it to either overwrite the file or create a new file with a number added to it. Since I know so little perl I think I'm just going to take the easy way for now and just have it overwrite it. My dream solution would be for the program to see if the file exists, if so ask the user if he wants to overwrite or rename. I don't know how to do this of course, but if anyone would like to show me how that would be great smile Instead, I'll just make it use the normal name, but add on the username.


Code:
code:


So now lets say you upload Test.zip and your name is John Smith it will rename the file "JohnSmith-Test.zip".

<FONT COLOR="#000000" SIZE="1">[ July 13, 2001 04:21 PM: Message edited by: James Lewis ]</font>

Top
#134100 - 07/13/01 04:20 PM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
OH BTW... I am not sure this would work if you allow unregistred users to post. Since it is using a cookie give to the user by the UBB, it would probably just give you something like "-test.zip" unless the UBB gives unregistred users a generic username, in which case it would be genericusername-Test.zip. Anyways. One last thing... I fixed the problem with it giving bad URLs for files with spaces in their names.

just put "$Filename =~ s/ /%20/g;"
below this:

#### file uploaded ######

in upload.cfg. Like I said, I know VERY little perl... like none really, so use these things at your own risk.

Top
#134101 - 07/13/01 07:02 PM Re: [6.0x] ELY_M's Upload Modification
humble [ThC] Offline
Member

Registered: 01/29/01
Posts: 76
Code:
quote:</font><HR>Originally posted by Dave_L:
[b]Re: corrupted files

On non-Unix/Linux platforms, you should use [i]binmode[/i] for reading/writing binary files:

<BLOCKQUOTE><font size="1" face="Verdana, Helvetica, Arial">code:


It's ok to use binmode on Unix platforms too. It's unnecessary, but doesn't hurt anything.

<FONT COLOR="#000000" SIZE="1">[ July 10, 2001 05:26 PM: Message edited by: Dave_L ]</font>[/b]<HR></BLOCKQUOTE>

Just to clearify for other Windows users who have the issue where it corrupts your files...

The above instructions work perfect, but there not instructions 8)...

SO:

Code:
code:


Thank DaveL for the FIX!!!!
_________________________

Top
#134102 - 07/13/01 09:39 PM Re: [6.0x] ELY_M's Upload Modification
Brett Offline
Moderator

Registered: 05/04/01
Posts: 992
Loc: Twinsburg, Ohio
Hey james lewis, do you think it's possible to upload as the member number?

Top
#134103 - 07/13/01 10:54 PM Re: [6.0x] ELY_M's Upload Modification
humble [ThC] Offline
Member

Registered: 01/29/01
Posts: 76
Quote:
quote:


HEHE... I just typed about 7 FULL paragraphs about how & why that would be a bad idea, then relized what you were trying to accomplissh.....(i.e. the uploader would only have the option to upload one file per type, cuz it would overright the existing file if it was limited to saving ONLY as the usernumber...)

BUT, you're probably setting your upload dir to the Custom Avatars folder, so your users can upload there own custom, and have it be available from the Personal Option ??? right?

If so... Yes, it's TOTALLY possible, and I think I can figure it out!... I'm looking in to it, the code where it lies is already posted in one of the above message, where it went from randomfilename to usernameandnumber.
_________________________

Top
#134104 - 07/14/01 11:59 AM Re: [6.0x] ELY_M's Upload Modification
Brett Offline
Moderator

Registered: 05/04/01
Posts: 992
Loc: Twinsburg, Ohio
Quote:
quote:


that's what i've trying to accomplish since this hack came out. To me, this hack went hand in hand with qasic's avatar hack, and would be great if i used it for the personal ones! I've been asking everybody how to do this and if you can pull this off, you'll be a godlike hacker in my book!

Top
#134105 - 07/15/01 09:50 AM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
It's real easy actually. You see my above code to make it so that it adds the username to the file? Here is what you would do if you wanted it to add their usernumber instead of their name to the file:
Code:
code:



If you want JUST the usernumber to be in the filename, then just do this:

Code:
code:


<FONT COLOR="#000000" SIZE="1">[ July 15, 2001 10:07 AM: Message edited by: James Lewis ]</font>

Top
#134106 - 07/15/01 09:57 AM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
And again, let me warn anyone that using my changes is a risk. It is sloppy, and I have no idea what I am doing smile It is very likely that this code would not work if you disabled cookies, and while it works perfectly on my windows 2000 server, I have no idea how it will work on other configurations. One last thing. You might prefer to use the username instead of the usernumber if that was the onlything in the file name. In that case just replace the line

if ($ubber[4] ne '') { $user_number = $ubber[4];

with

if ($ubber[0] ne '') { $username = $ubber[0]; }

and the line

$Filename = join '.', $user_number, @yourvar[1];

with

$Filename = join '.', $username, @yourvar[1];

<FONT COLOR="#000000" SIZE="1">[ July 15, 2001 10:09 AM: Message edited by: James Lewis ]</font>

Top
#134107 - 07/15/01 04:37 PM Re: [6.0x] ELY_M's Upload Modification
Brett Offline
Moderator

Registered: 05/04/01
Posts: 992
Loc: Twinsburg, Ohio
I'm trying to test it out, but i keep getting this.

Quote:
quote:


Should i just delete this part?

Top
#134108 - 07/16/01 02:33 PM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
Hmmm. Only thing I can think of is this (and it is a blanket fix approach... I hope someone who has some time will be able to find all my enificiencies and fix them). If this doesn't work... I really have no idea smirk

Make sure all of these are listed in your upload.cgi

require "vars_config.cgi";
require "$vars_config{VariablesPath}/vars_display.cgi";
require "$vars_config{VariablesPath}/vars_misc.cgi";
require "$vars_config{VariablesPath}/vars_email.cgi";
require "$vars_config{VariablesPath}/vars_registration.cgi";
require "$vars_config{VariablesPath}/vars_template_match.cgi";
require "$vars_config{VariablesPath}/vars_wordlets.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_mods.cgi";
require "ubb_lib.cgi";
require "ubb_lib_time.cgi";
require "$vars_config{CGIPath}/ubb_lib_2.cgi";
require "$vars_config{NonCGIPath}/Templates/public_common.pl";

require "$vars_config{VariablesPath}/vars_search.cgi";
require "$vars_config{VariablesPath}/vars_pm.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_err.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_img.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_date.cgi";

I forgot to mention that I added any files required by ultimatebb.cgi to my upload hack in case the cookie code I copied from there was using other files required by the ultimatebb.cgi file. Many if not all of those may be unnecessary... but I wanted to make sure it worked.

<FONT COLOR="#000000" SIZE="1">[ July 16, 2001 02:34 PM: Message edited by: James Lewis ]</font>

Top
#134109 - 07/16/01 04:27 PM Re: [6.0x] ELY_M's Upload Modification
Brett Offline
Moderator

Registered: 05/04/01
Posts: 992
Loc: Twinsburg, Ohio
That was the problem! Works like a charm! Thanks a million!

Top
#134110 - 07/17/01 12:00 AM Re: [6.0x] ELY_M's Upload Modification
humble [ThC] Offline
Member

Registered: 01/29/01
Posts: 76
Hmmm. Only thing I can think of is this (and it is a blanket fix approach... )..

What did this fix?
_________________________

Top
#134111 - 07/17/01 02:15 AM Re: [6.0x] ELY_M's Upload Modification
AllenAyres Administrator Online   content
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
sub set_page_elements is found in public_common.pl so you might wanna cut your require statements down a good bit, it should speed up your forums a little.

require "$vars_config{NonCGIPath}/Templates/public_common.pl";
_________________________
- Allen wavey
- What Drives You?

Top
#134112 - 07/17/01 11:14 AM Re: [6.0x] ELY_M's Upload Modification
James Lewis Offline
Junior Member

Registered: 07/12/01
Posts: 8
Hmm, ya I just tried commenting out all the requireds that I put in from ultimatebb and it worked fine without them. So these should be unncessary:

require "$vars_config{VariablesPath}/vars_search.cgi";
require "$vars_config{VariablesPath}/vars_pm.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_err.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_img.cgi";
require "$vars_config{VariablesPath}/vars_wordlets_date.cgi";

Thanks Allen! I don't see a difference in speed, but that might be different on a server with heavy load.

Top
#134113 - 07/17/01 10:11 PM Re: [6.0x] ELY_M's Upload Modification
Dino Offline
Member

Registered: 03/23/01
Posts: 53
Loc: Troy, MI
Anybody know why I would get this error after hitting the upload button?

Software error:
CGI open of tmpfile: Permission denied

For help, please send mail to this site's webmaster, giving this error message and the time and date of the error. [Tue Jul 17 23:37:36 2001] c:inetpubwwwrootforumcgi-binupload.cgi: CGI open of tmpfile: Permission denied

I'm baffled. I've tried every different permission combination known to man for the /uploads directory, as well as the two upload.cgi files.

Any help would be greatly appreciated.
_________________________
Dino Filias
http://dinofilias.com

Top
Page 7 of 9 < 1 2 3 4 5 6 7 8 9 >


Who's Online
2 registered (AllenAyres, blaaskaak), 19 Guests and 11 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Spell Check [beta]
by AllenAyres
12/01/08 09:32 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
Active Topics.
by AllenAyres
11/11/08 02:13 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25449
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks