Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Joined: Apr 2001
Posts: 299
Member / MultiHacker
Member / MultiHacker
Offline
Joined: Apr 2001
Posts: 299
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.

Sponsored Links
Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
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.

[ July 10, 2001 05:26 PM: Message edited by: Dave_L ]

Joined: Jun 2001
Posts: 6
Junior Member
Junior Member
Offline
Joined: Jun 2001
Posts: 6
Thanks dave_L!!

Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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.

Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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!

Sponsored Links
Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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".

[ July 13, 2001 04:21 PM: Message edited by: James Lewis ]

Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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.

Joined: Jan 2001
Posts: 75
Member
Member
Offline
Joined: Jan 2001
Posts: 75
Code
quote:</font><HR>Originally posted by Dave_L:
Re: corrupted files

On non-Unix/Linux platforms, you should use binmode 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.

[ July 10, 2001 05:26 PM: Message edited by: Dave_L ]


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!!!!

Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
Hey james lewis, do you think it's possible to upload as the member number?

Joined: Jan 2001
Posts: 75
Member
Member
Offline
Joined: Jan 2001
Posts: 75
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.

Sponsored Links
Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
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!

Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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:

[ July 15, 2001 10:07 AM: Message edited by: James Lewis ]

Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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];

[ July 15, 2001 10:09 AM: Message edited by: James Lewis ]

Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
I'm trying to test it out, but i keep getting this.

Quote
quote:
Should i just delete this part?

Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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.

[ July 16, 2001 02:34 PM: Message edited by: James Lewis ]

Joined: May 2001
Posts: 1,042
Likes: 7
Moderator
Moderator
Offline
Joined: May 2001
Posts: 1,042
Likes: 7
That was the problem! Works like a charm! Thanks a million!

Joined: Jan 2001
Posts: 75
Member
Member
Offline
Joined: Jan 2001
Posts: 75
Hmmm. Only thing I can think of is this (and it is a blanket fix approach... )..

What did this fix?

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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?
Joined: Jul 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Jul 2001
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.

Joined: Mar 2001
Posts: 56
Member
Member
Offline
Joined: Mar 2001
Posts: 56
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.

Joined: Dec 2000
Posts: 20
Junior Member
Junior Member
Offline
Joined: Dec 2000
Posts: 20
Ok, here's my problem. Hack installed, uploads work fine, all files CHMOD correctly. When I post the message and click on the link to the file, I get :

Forbidden
You don't have permission to access /cgi-bin/uploads/995445859.zip on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Not sure what to do. Any help would be appreciated! Thanks smile


ICQ - 28882963
Email - [email protected]
Joined: Dec 2000
Posts: 20
Junior Member
Junior Member
Offline
Joined: Dec 2000
Posts: 20
Nevermind, I seemed to have fixed it smile Great hack!


ICQ - 28882963
Email - [email protected]
Joined: Jul 2001
Posts: 24
Junior Member
Junior Member
Offline
Joined: Jul 2001
Posts: 24
Hi,
i have install the hack and it works.

i will use this script for my User to load his UserPic up. The User can only use one pic also the file must be overwrite. (what it do now)
Now the question:
did anyone know how i can bind it in the user profil in user_profil[20] (the User pic)?

thx

[ July 19, 2001 12:39 AM: Message edited by: Ta Lun 3 ]

Joined: Mar 2001
Posts: 56
Member
Member
Offline
Joined: Mar 2001
Posts: 56
I'm running my Bulletin Board on Windows 2000 Server, IIS 5.

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've tried every different permission combination known to man for the /uploads directory, as well as the two upload.cgi files.

Is it something basic that I am messing up? Will this only work on a unix server?
Any help would be greatly appreciated.

Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
When I was first leaning how to write an upload script, I tried it on both an NT server and a Linux server. I got the one on the Linux server to work, but was never successful with the NT server. I suspect it had something to do with the server configuration.

Joined: Mar 2001
Posts: 56
Member
Member
Offline
Joined: Mar 2001
Posts: 56
I think that's my problem...

In Miscellaneous Settings, DIR path to the uploads folder (/user/home/public/name/uploads), what do I enter?

c:inetpubwwwrootforumcgi-binuploads or
c:/inetpub/wwwroot/forum/cgi-bin/uploads or
/uploads or
/cgi-bin/uploads or
forum/cgi-bin/uploads or
../uploads or...

I went through most of the combinations with no luck.

Anybody have any idea?

Joined: Aug 2000
Posts: 335
Member
Member
Offline
Joined: Aug 2000
Posts: 335
By "server configuration", I meant that something might have to be changed by someone with admin access to the server. The NT server I was using was operated by a commercial hosting service, and the tech support person wasn't very cooperative about helping with CGI problems.

Joined: Mar 2001
Posts: 136
Journeyman
Journeyman
Offline
Joined: Mar 2001
Posts: 136
I know it been awhile since I worked on this hack.

I recoded the upload.cgi and added the control panel option to allow the admin to choose the way the filenames to be uploaded.

I added three choices in the options.

1. random number
2. username
3. member number

but none of the codes that James Lewis posted had worked frown

so I left 3 options pointing to the random code for a while.

Re-download the zip if you want to view the new control panel option on filenames.

The new option for filenames is not functional yet.

I want to say thank for the efforts from the people here smile

BTW: I work on unix server.

[ July 24, 2001 06:00 AM: Message edited by: ELY_M ]

Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
ELY_M: (I think)
Code
code:

[ July 24, 2001 07:00 AM: Message edited by: LK ]

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
smile

The code you poste LK gives me this in the upload popup:

[ URL=http://www.domain.com/cgi-bin/uploads/][/URL]

(without spaces)
It doesn't give the file name in the url or in the space between the ] and [/url]

any more ideas? smile


[edit: Part of the problem is that it says it uploaded the file but there's no file in the upload directory.

[edit part2: in the upload popup, when it says Upload Finished at the top, it says: upload_file_name_dontworry at the bottom. confused


- Allen wavey
- What Drives You?
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
That's weird, it works in my board.

Can I post a link to "my" version? I changed some other parts, maybe that's why it's like that.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
that might help, I am sure ELY_M welcomes the bugfixes smile


- Allen wavey
- What Drives You?
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Ok, then, http://lkubb.dns2go.com/ELYS_upload_hack.zip

I also renamed these files, made them ?ubb=upload_form (so you have to change public_new_topic_form.pl, public_new_reply_form.pl, public_pm_form.pl and ultimatebb.cgi) and some small unnecessary parts.

If you didn't get ELY_M's part with {filename_q}, I guess that's the problem, and if so also change cp_lib.cgi, cp_vars_misc.pl, and choose whatever you want in the CP.

One last thing, I also made it be transferred with binary mode so it won't add an extra carriage

[edit]spelling mistake[/edit]

[ July 26, 2001 11:47 AM: Message edited by: LK ]

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
seems to be working fine now LK, thanks for the help smile


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 76
Member
Member
Offline
Joined: Jun 2001
Posts: 76
have been looking for this a long time! works great for 6.04f also. Thanks alot!!!!!!!! laugh smile

Joined: Jul 2001
Posts: 22
Junior Member
Junior Member
Offline
Joined: Jul 2001
Posts: 22
Suggestion
For people to easily choose whether to display the uploadet image as an url or an image, do this;

ubb_upload.cgi

Find:

Code
code:

Add below:
Code
code:

Be shure to remove the three *** in "onMouse***Over

Save & Close

Joined: Mar 2001
Posts: 56
Member
Member
Offline
Joined: Mar 2001
Posts: 56
NT/IIS TMPFILE Permission Problem Resolution

I know most of you using UBB salivate over the meer mention of UNIX, LINIX, and Apache. But some of us out here actually have to use NT servers.

I've had a problem that nobody could figure out using ELY_M's upload hack running on NT/IIS5.

The specific problem I was having was a CGI error after clicking the upload button. Specifically, a permission issue when writing to a temp file.

Well, here's the solution: create a C:TEMP directory if one doesn't exist, and give your IUSR account read/write access. Scary, I know.
EDIT: Actually, give IUSER read + write + delete. You can add delete in WIN2000 by clicking on the advanced button. Otherwise, the temp directory will fill up with the same files in the uploads directory. Or, just add "Modify" permission and that will cover all the permissions needed (I prefer just R+W+D).

Problem fixed.

Of course, I don't know how excited your webhost will be to add a C:TEMP directory and then give read/write access to IUSR on it. But some of us are the webhosts, and have that flexibility.

Are there any security risks in doing this? Any comments would be appreciated.

And, now that I see how it works, thanks ELY_M and LK for putting together an awesome hack. THANK YOU! THANK YOU! THANK YOU!

[ August 05, 2001: Message edited by: Dino ]

Joined: Mar 2001
Posts: 56
Member
Member
Offline
Joined: Mar 2001
Posts: 56
quote:
Originally posted by SnowDog:
This hack is very cool... I can't wait to get it working on my site!

What am I missing?? I'm using Win2000 / IIS...

When I try to upload I get the upload screen but then I select the file and press upload and get an Access Denied message...



Snowdog, did you try my solution?

Joined: Apr 2001
Posts: 235
Member
Member
Offline
Joined: Apr 2001
Posts: 235
I have this hack ported to 6.1.x. I can post it in the 6.1 Beta Mods forum if it is ok with Allen and Ely_M

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Dino,

Thanks for the tip, I've had users with this before but hit it myself last night... I googled for a solution and yours was the only one that worked! wink

Page 4 of 5 1 2 3 4 5

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)