UBB.Dev
Posted By: AllenAyres [6.0x] ELY_M's Upload Modification - 05/01/2001 11:06 PM
Name: Upload Mod for V6

Description: This is a easy to install modification that allows your users to upload files to your site. You configure settings from the control panel to disallow different types of files to be uploaded. Developed for 6.04c, your files may be slightly different.

Author: ELY_M

Demo: https://www.ubbdev.com/db/cgi/ultimatebb.cgi?ubb=newtopic&f=20

Link: http://elym.tripod.com/ELYS_upload_hack.zip
Posted By: mw2com Re: [6.0x] ELY_M's Upload Modification - 05/01/2001 11:17 PM
FYI
You do not have permission to enter this area.
» Please use your browser's back button to return.

It would be nice if we could all see the demo!
Posted By: Webdaddie Re: [6.0x] ELY_M's Upload Modification - 05/01/2001 11:21 PM
Works great here! Opps, I see what you are talking about the DEMO, nevermind, sorry!

Quote
quote:
[ May 01, 2001 04:27 PM: Message edited by: Webdaddie ]
Posted By: mw2com Re: [6.0x] ELY_M's Upload Modification - 05/01/2001 11:37 PM
Well its there.. and CP works But when i click on the link to upload a file i get

Script execution error
Unable to execute script due to a configuration problem.
Please notify the webmaster of this error.

exec() returned: 2: No such file or directory

And the links in the CP are right

[ May 01, 2001 04:59 PM: Message edited by: Mikey ]
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 12:04 AM
you have to set a folder up and give it 777 permissions for the uploads to go into
Posted By: Tolitz Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 12:07 AM
Here are a couple of things probably not mentioned in the documentation:

* The /uploads folder you create must be CHMODed 777.

* The wordlets modification was a little outta whack when I did it. Here may be a possible solution:

When it says to add lines like this:

upload_link => "Upload File Form",

ELY actually meant to add it like this:

upload_link => q~Upload File Form~,

Do these changes with each line in the wordlets to be included into vars_wordlets.cgi, unless you wanna just put these lines AS IS into vars_wordlets_mods.cgi, in which case you would have to add:

require "$vars_config{VariablesPath}/vars_wordlets_mods.cgi";

into the uploads.cgi file...

[ May 01, 2001 05:08 PM: Message edited by: Canis Lupus ]
Posted By: Webdaddie Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 1:26 AM
Think we can get this running for 6.04c?

Quote
quote:
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 1:28 AM
It is running on 6.04c...:) What are you having problems with?


CL, good suggestions. For the wordlets, I suggested using the vars_wordlets_mods.cgi file as well, to make upgrading the ubb a little easier, and to help with standardization for modifications.

This one is only a day old, we'll give ELY_M some time to work out the kinks...
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 4:13 AM
I worked thru the code and switched the wordlets over to wordlet_mods

I also recoded some of code to add more control for header and footer.

I also added some new CP hacks that let you change the size of the popup window and placment (where you want popup window to appear on left and top)

I hope it is much better for you than yesterday.

I also added some information for people who use older versions of ubb.

I hope it is ok that I added the wordlet_mod dev kit for someone who is first time to hacking his/her ubb.

let me know if it is not ok.

The zip is updated smile

[ May 01, 2001 09:14 PM: Message edited by: ELY_M ]
Posted By: qasic Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 5:11 AM
Ely,

Good hack. Some quirks:

vars_wordlets_mods.cgi file should ALWAYS have the following line: mod_wordlets => q~Modifications Wordlets~,. Please have that line in.

Misc Settings: You accidentally placed:

------------------
&RegField ("Illegal file format #1 ", "illegalfile1", "yes", "3", "3", "Type all file extensions you want to block from being uploaded by the users in the text boxes below. Only put one extenison in one text box. all file extenisons *.exe will be not be uploaded and blocked. Do not add "." before the extenison. as a example, you just put in "exe" in one text box and put "zip" in other text box. the script does this job already. Do not use quotes.

Leave those text boxes blank if you do not want to block any file extenisons from being uploaded by the users.", "$vars_misc{illegalfile1}");
---------------

three times in your instructions. Once will suffice in my opinion.

Those are my major quirks. There are others involving capitalization but those are minor.

Great job.

q
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 5:26 AM
thanks qasic,

human mistakes do happen.
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 5:54 AM
the new zip is uploaded. I did corrected mistakes that qasic told me about.
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 6:59 AM
installed easily ELY, nice work smile
Posted By: mw2com Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 10:10 AM
well ive uploaded the new hack it gose in very nice and its more understandable
thanks!!!!!

but i might be doing somthing wrong here but when i click the link for upload all i get is a window pop up that says
------------------------------------------
Script execution error
Unable to execute script due to a configuration problem.
Please notify the webmaster of this error.

exec() returned: 2: No such file or directory
-----------------------------------------

Now my dirs are correct and the chmod is 777

any ideas?
Posted By: melder Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 1:09 PM
1) is your "zip" file incorrect ? i get no download !!!

2) if u have a "show me the pics" script.

show me the "gif" and "jpg" in a DIR (like ubb 5 - gallerie hack) in a HTML page incl. the file name.

... so u can add "avatar" or "smilies"

hope u understand wink >> www.chat-board.de
hope
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 2:44 PM
Mikey: login there with your nick/password and enter https://www.ubbdev.com/db/cgi/ultimatebb.cgi?ubb=newtopic&f=18

Melder: Don't use any download programs like Getright/DAP, because in Tripod you must click on something.

ELY_M: nice job smile

[ May 02, 2001 07:47 AM: Message edited by: LK ]
Posted By: mw2com Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 5:04 PM
so i have seen the demo and it looks good laugh

but mine is now installed adn i keep getting this error when i click on the upload link
_________________________________________

------------------------------------------
Script execution error
Unable to execute script due to a configuration problem.
Please notify the webmaster of this error.

exec() returned: 2: No such file or directory
-----------------------------------------

May Paths are ok
************************************
/home/web/www.*******com/upload
and
http://www.*******.com/upload
**************************************
MY directorys are correct
and set to the right chmod 777
***************************************

But it still dont work
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 8:58 PM
It works, just a few suggestions:


    [*]Add it also to edit (which I believe it's just the same as in public_new_topic_form.pl/etc).

    [*]Add an option that the administrators can remove files, by filename or by user number.


Thanks for this hack.
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 9:00 PM
Mikey, what's your UBB's url?
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 9:08 PM
Can anyone make a new description for the UBB Version 6.0? Please Please? Need Help!

I have test it but the Error was:
Code
code:

The Error came after the save the CP Settings!
All Files and dirs are correct and the chmod is 777!

And I can't see the Demo! The error:
FYI You do not have permission to enter this area.
» Please use your browser's back button to return.

It would be nice if we could all see the demo!
Please Help!

SkipperII

(Sorry for my terrible english) confused confused

[ May 02, 2001 02:14 PM: Message edited by: SkipperII ]
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/02/2001 9:35 PM
SkipperII: like I told to Mikey, login there with your nick/password and enter https://www.ubbdev.com/db/cgi/ultimatebb.cgi?ubb=newtopic&f=18
Posted By: mw2com Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 12:29 AM
http://www.cytek.uk.com/cgi-bin/ultimatebb.cgi

Its not ready yet just a few mwssages on there id just like to get this file upload working so i can let my cutomers use it for data file uploads.
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 12:48 AM
where is your uploads folder ?

I seem cant find the folder uploads or upload

I tryied to type

http://www.cytek.uk.com/cgi-bin/upload

or

http://www.cytek.uk.com/cgi-bin/uploads


you have to create uploads folder

[ May 02, 2001 05:49 PM: Message edited by: ELY_M ]
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 12:50 AM
oh I found it..

http://www.cytek.uk.com/upload/
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 12:56 AM
try to move your upload folder to

http://www.cytek.uk.com/cgi-bin/upload
Posted By: mw2com Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 10:05 AM
thanks for your help
This man is fantastic eek

did you find anything in my scripts?
pm me on my board
i will check later
Posted By: technoforum.de Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 5:44 PM
hi there,
just a few questions: i'd like to use this upload-hack just for ONE single forum, is this possible..? and: is there any possibility to upload the files to another server..? because i would like to host the ultimatebb AND the files on two different servers to avoid a 'disk quota'error due the fact that we have a limited webspace for the forum-engine...:/
best regards and this hack sounds really interesting,
chris
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 5:59 PM
Quote
quote:

sound great idea to add another CP hack to specific one forum to allow file uploading smile
it depends if the server is allowing external linking. it is possible. you have to try it.
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/03/2001 11:44 PM
Nobody can help me to install the Hack in a UBB 6.0 ????

SkipperII
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/04/2001 1:36 PM
I did some revising the upload hack.

I moved the toggle on and off for allowing uploads in to forum settings section in the CP.

Admin should be able to allow file upload in specific forum.

I added new CP hack for allowing File uploads in private messages.

Admin should have right to decide to allow the file uploads in private messages.

Im sure that some forums want to have users private message files and others want to block that.


The upload zip is updated.

redownload it again smile

I hope it works better for the users now.
Posted By: Buzzin Hornet Re: [6.0x] ELY_M's Upload Modification - 05/04/2001 2:06 PM
Now you have an option with files wich are are not allowed, but I wat something so I can specify the files which must be allowed, how??
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/04/2001 2:42 PM
ELY_M: Bug: it isn't shown when I add a new forum.


Fix (not tested):
Code
code:
you can also move CHECKED to No, if you want it to be the default one

[ May 06, 2001 06:34 AM: Message edited by: LK ]
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/04/2001 3:04 PM
Quote
quote:
DO not put any extenisons that you want allow smile


If you leave all text boxes blank. you are allowing ALL kinds of files.

If you put in exe and you are ONLY blocking all *.exe files and allowing all others kinds of files execpt .exe
############################################


LK:

Thanks for advising me about that smile

[ May 04, 2001 08:04 AM: Message edited by: ELY_M ]
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/04/2001 3:19 PM
The zip is updated with the fix that LK mentioned smile
Posted By: Buzzin Hornet Re: [6.0x] ELY_M's Upload Modification - 05/04/2001 4:43 PM
Quote
quote:
DO not put any extenisons that you want allow smile


If you leave all text boxes blank. you are allowing ALL kinds of files.

If you put in exe and you are ONLY blocking all *.exe files and allowing all others kinds of files execpt .exe
[/QUOTE]


I only want my members to upload .gif and .jpg! Now, I can't put al of the other extensions in my cp
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/04/2001 5:04 PM
Buzin: (untested)

***************
OPEN upload.cgi
***************


find
----
if ( ($Filename =~ /^.+(.$vars_misc{illegalfile1})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile2})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile3})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile4})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile5})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile6})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile7})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile8})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile9})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile10})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile11})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile12})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile13})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile14})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile15})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile16})$/i)
|| ($Filename =~ /^.+(.$vars_misc{illegalfile17})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile18})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile19})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile20})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile21})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile22})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile23})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile24})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile25})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile26})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile27})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile28})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile29})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile30})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile31})$/i) )


replace with:
-------------

unless ( ($Filename =~ /^.+(.$vars_misc{illegalfile1})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile2})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile3})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile4})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile5})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile6})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile7})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile8})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile9})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile10})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile11})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile12})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile13})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile14})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile15})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile16})$/i)
|| ($Filename =~ /^.+(.$vars_misc{illegalfile17})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile18})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile19})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile20})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile21})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile22})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile23})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile24})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile25})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile26})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile27})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile28})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile29})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile30})$/i) || ($Filename =~ /^.+(.$vars_misc{illegalfile31})$/i) )

The only difference is "unless" instead of "if".
Again, it's untested, so backup before.

LK

Edit: removed [code] because it messed the thread.

[ May 06, 2001 06:33 AM: Message edited by: LK ]
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/05/2001 11:15 AM
LK:

Cool idea smile

It look like It will work better.

I have to change the wording in the CP for allowing exact extenisons.


Thank you LK smile
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/06/2001 4:18 AM
somone fix this messed up thread please....


I re-coded the code to let "allow" files extensions instead of "block".

few new wordlets are added.

Please redownload the zip and redo the upload hack on your forum if you want the new way for the file extenisons.

Thanks to LK for ideas smile

It is helpful to listen to the users smile
Posted By: saehoon Re: [6.0x] ELY_M's Upload Modification - 05/06/2001 12:20 PM
I will get this installed soon on my boards.. I haven't had the time yet to take a close look at it, however I have one request.

How about instead of only being able to upload files on a particular post, create it so it's like a file upload utility. What I mean is can you modify it so that each user can access their file space through their profile where they may then upload/delete and manage their files through the web browser.. similar to free webspace such as geocities etc.

I hope you understood what I just said... and hopefully you'll go through with it, but anyway great hack.. thanks! smile
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/06/2001 1:43 PM
Bug:
There is no Upload in PM switch in Control Panel.
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/06/2001 2:37 PM
Quote
quote:

I forgot to add this in my instructions

it is just about cp_vars_misc.pl part in instructions.


Thanks again smile

the zip is updated smile

[ May 06, 2001 07:41 AM: Message edited by: ELY_M ]
Posted By: Psyc Re: [6.0x] ELY_M's Upload Modification - 05/06/2001 5:15 PM
hi ely,

nice work

but i got a little problem

the upload window shows me an error

do you have any clue why i can't see the upload window?

[ May 08, 2001 08:53 AM: Message edited by: cdr700 ]
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/07/2001 5:53 AM
I got 500 internal error.

I have no idea, but

you need to make sure the perl path is correct.

Which ubb files you are using on your server.

normal or local files ?


make sure you upload the upload files in ASCII mode in your ftp client.

make sure you chmmod the upload files and the upload folder to 777.
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 05/07/2001 7:21 AM
Looking good ELY_M smile
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/07/2001 11:58 AM
BTW, What happens if the user uploads .htpasswd and .htaccess files?
Posted By: Psyc Re: [6.0x] ELY_M's Upload Modification - 05/07/2001 4:39 PM
hi ely

i'm using normal files on my server

and i changed mod to 777 upload and the 2 cgi files

could it be that my server does not support if somebody tries to upload something??

but thanks anyways this hack is really cool
i can configure it in cp but it won't work

ok i think i need to work it out

if you got some clues plz tell me
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/07/2001 5:08 PM
Another thing, you can disable uploads in some forums, but if the user enters cgi-bin/upload_form.cgi, it will upload anyway; also unregistered users can upload, and I don't think I can disable it; and the same thing if I want only admins/mods.
What you can do is make it ultimatebb.cgi?ubb=upload_form (and to not make it confusing I think you should make the upload_form.cgi be ubb_upload_form.cgi and the other one ubb_upload.cgi), and then it will have all login information.
Also, when you'll do it, the CGI path will be in $vars_config{CGIPath} or something like that, so you can just make it automatically $vars_config{CGIPath}/uploads.

Now, your script doesn't work if Variables Path is different than cgi-bin; it will also be fixed after you'll do it if you'll do $vars_config{VariablesPath}.

[ May 07, 2001 10:11 AM: Message edited by: LK ]
Posted By: Psyc Re: [6.0x] ELY_M's Upload Modification - 05/07/2001 5:35 PM
hi again,

i found the problem

your path in upload_form.cgi

is #!/usr/bin/perl5

my is #!/usr/bin/perl


so it didn't match and i changed it and now it works

great work man
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/08/2001 9:36 AM
Thanks to LK again.

I added the CP hack that an Admin can decide if he or she wants to allow unregistered users to upload.

I also added some new codes and did recoding for the new topic and reply and pm forms.


The zip is updated.
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/09/2001 1:51 AM
ELY_M du you thing i have a chance to install it in a older Version of the UBB 6.x? I will test it but when you say no chance ..... that i don't install it!

Sorry for my English

SkipperII
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/09/2001 7:13 AM
Skipper II: Please read the instructions carefully. I have placed some instructions for people who want to keep older ubb versions.

I think you should upgrade your board to ubb 604d. It has more better security fixes than previous versions.

[ May 09, 2001 12:14 AM: Message edited by: ELY_M ]
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/10/2001 9:54 PM
Hello,

thank you i had a older File of your Upload hack! The New File Descrition for older UBB is very good! But i have one Problem all works in CP but when i save the Miscellaneous Settings, the Forum dosen't work the error is:
Code
code:

Any Idea?

SkipperII confused

[ May 10, 2001 02:55 PM: Message edited by: SkipperII ]
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/11/2001 9:22 AM
ELY: I think you should make that files have a random name, like a368dq46.jpg (8 random letters/numbers).

Reasons:


    [*]If somebody posts something and I post another one with the sane name, it will overwrite the old one, and if it sucks they will blame the first one.

    [*]Files like .htpasswd can cause a security risk, so now it will be a456f34g.htpasswd, which I think it's okay.


If you choose to do it, just make sure the file doesn't already exist, because there can be even 2 random things that are the same.


If you think it's too ugly/dumb for you, make directories by the member number, like /cgi-bin/00000001/file.ext, and guests have 00000000; but I think it's worse, because of the guests and some other reasons I forgot wink


LK.
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/11/2001 9:43 PM
@ELY_M

all the entrys of your hack in the vars_misc.cgi (After the when i Save the Settings in CP) beginn with
Code
code:
and end with
Code
code:
dosen't work and give this Error:
Code
code:

The chmod is ok!
The Perl is ok
The hack is corecked added (i hope)!

Can you help me?

SkipperII confused confused

[ May 11, 2001 02:44 PM: Message edited by: SkipperII ]
Posted By: MarkMac Re: [6.0x] ELY_M's Upload Modification - 05/11/2001 11:34 PM
Possible big security risk?

When I specify that I want only jpg files to be uploaded, then go to post a file, such as regedit.exe, it says in the window that such a filename is not acceptable to upload, however it still uploads it to the directory.. So it wouldn't take much figuring out to upload a file and then find the url to get to it...
Posted By: MarkMac Re: [6.0x] ELY_M's Upload Modification - 05/12/2001 2:25 AM
Ok, I changed some of the script, and seems to be working now.... here is what i did:

In upload.cgi

Find:

Code
code:

and move it directly under the lines:


Code
code:

Then find:

Code
code:

and replace it with:

Code
code:


This should make the script check the file type first, before uploading it.

As well, it will also generate a random filename so that one file upload will not overwrite one that is already in the directory.

I am pretty new at CGI, so someone may want to take a look at it..
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/12/2001 2:36 AM
Quote
quote:

yeah, need to add some code so the file wont be uploaded.

[ May 11, 2001 07:47 PM: Message edited by: ELY_M ]
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/12/2001 2:53 AM
MarkMac: Thanks for helping out with the security and file name thing.

Sorry, It took some time for me to read everything in here.
Posted By: MarkMac Re: [6.0x] ELY_M's Upload Modification - 05/12/2001 3:02 AM
The only thing that I can see is a problem with what I did is that if someone uploads a file like joe.blow.jpg, then it will reject the file, because it thinks the file extension is .blow...... someone may be able to correct this for us tho... As I said, I am pretty green at CGI.

Cheers
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/12/2001 10:52 AM
@ELY_M

you have no idea to my problem with the vars_misc.cgi entrys?


SkipperII confused confused
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/13/2001 4:17 PM
make sure you do cp_lib.cgi part in instructions.
open cp_lib.cgi


## for ubb604b and ubb604c ##

find this line

print FILE qq!FloodCheck => "$in{FloodCheck}",n!;
print FILE qq!use_cache => "$in{use_cache}",n!;
print FILE qq!FloodCheckSpan => q~$FloodCheckSpan~,n!;
print FILE qq!runOnLimit => q~$runOnLimit~,n!;
print FILE qq!stringLengthLimit => q~$stringLengthLimit~,n!;

#############
#
# for people who use older version * less than ubb604b *
# 6.0 - 6.01 - 6.02 - 6.03
#
# find this code
#
# print FILE qq!FloodCheckSpan => q~$FloodCheckSpan~n!;
#
#
# in ubb604a find this
#
# print FILE qq!runOnLimit => q~$runOnLimit~,n!;
#
###

add this new code after this ^^^

print FILE qq!upload_in_pm => q~$in{upload_in_pm}~,n!;
print FILE qq!upload_by_unreg => q~$in{upload_by_unreg}~,n!;
print FILE qq!SAVE_DIRECTORY => q~$in{SAVE_DIRECTORY}~,n!;
print FILE qq!SAVE_URL => q~$in{SAVE_URL}~,n!;
print FILE qq!MAXIMUM_UPLOAD => q~$in{MAXIMUM_UPLOAD}~,n!;
print FILE qq!header_in => q~$in{header_in}~,n!;
print FILE qq!footer_in => q~$in{footer_in}~,n!;
print FILE qq!popup_width => q~$in{popup_width}~,n!;
print FILE qq!popup_height => q~$in{popup_height}~,n!;
print FILE qq!popup_left => q~$in{popup_left}~,n!;
print FILE qq!popup_top => q~$in{popup_top}~,n!;
print FILE qq!allowedfile1 => q~$in{allowedfile1}~,n!;
print FILE qq!allowedfile2 => q~$in{allowedfile2}~,n!;
print FILE qq!allowedfile3 => q~$in{allowedfile3}~,n!;
print FILE qq!allowedfile4 => q~$in{allowedfile4}~,n!;
print FILE qq!allowedfile5 => q~$in{allowedfile5}~,n!;
print FILE qq!allowedfile6 => q~$in{allowedfile6}~,n!;
print FILE qq!allowedfile7 => q~$in{allowedfile7}~,n!;
print FILE qq!allowedfile8 => q~$in{allowedfile8}~,n!;
print FILE qq!allowedfile9 => q~$in{allowedfile9}~,n!;
print FILE qq!allowedfile10 => q~$in{allowedfile10}~,n!;
print FILE qq!allowedfile11 => q~$in{allowedfile11}~,n!;
print FILE qq!allowedfile12 => q~$in{allowedfile12}~,n!;
print FILE qq!allowedfile13 => q~$in{allowedfile13}~,n!;
print FILE qq!allowedfile14 => q~$in{allowedfile14}~,n!;
print FILE qq!allowedfile15 => q~$in{allowedfile15}~,n!;
print FILE qq!allowedfile16 => q~$in{allowedfile16}~,n!;
print FILE qq!allowedfile17 => q~$in{allowedfile17}~,n!;
print FILE qq!allowedfile18 => q~$in{allowedfile18}~,n!;
print FILE qq!allowedfile19 => q~$in{allowedfile19}~,n!;
print FILE qq!allowedfile20 => q~$in{allowedfile20}~,n!;
print FILE qq!allowedfile21 => q~$in{allowedfile21}~,n!;
print FILE qq!allowedfile22 => q~$in{allowedfile22}~,n!;
print FILE qq!allowedfile23 => q~$in{allowedfile23}~,n!;
print FILE qq!allowedfile24 => q~$in{allowedfile24}~,n!;
print FILE qq!allowedfile25 => q~$in{allowedfile25}~,n!;
print FILE qq!allowedfile26 => q~$in{allowedfile26}~,n!;
print FILE qq!allowedfile27 => q~$in{allowedfile27}~,n!;
print FILE qq!allowedfile28 => q~$in{allowedfile28}~,n!;
print FILE qq!allowedfile29 => q~$in{allowedfile29}~,n!;
print FILE qq!allowedfile30 => q~$in{allowedfile30}~,n!;
print FILE qq!allowedfile31 => q~$in{allowedfile31}~,n!;
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/13/2001 7:22 PM
Okay i check it wait !


SkipperII confused
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/13/2001 8:02 PM
Yes i have it! look:

Code
code:
(UBB Version 6.0)

I don't understand where is the error?

SkipperII :rolleyes: :rolleyes:
Posted By: SnowDog Re: [6.0x] ELY_M's Upload Modification - 05/14/2001 1:34 AM
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...

Any help?
http://www.rockcrawlin.com/cgi-bin/ultimatebb.cgi?ubb=upload_form

Thanks!
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/14/2001 5:26 PM
@ELY_M

i have Checked all .... i installed all Hacks i'am sure (Hope so) ! Have you test it in 6.0? The hack don't work in my Forum! ....! I have the Star hack installed is that the Problem? confused confused confused

SkipperII

[ May 14, 2001 01:06 PM: Message edited by: SkipperII ]
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/17/2001 5:44 AM
Quote
quote:
why you cant upgrade to ubb604d ?

I never tested it in 6.0
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/17/2001 5:48 AM
Quote
quote:
it look like as you got it working.

I got this message smile


FYI
You are not logged in. You must be logged in (and registered) to perform this function.
Login or Register

» Please use your browser's back button to return.



BTW: if you want me to test it more. create temp account smile
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 05/17/2001 3:56 PM
Worked great, but one thing...
Can someone adjust it so that the uploads will show as avatars? I installed qusic's avatar_hack_ubb6_v0.0007, so can i make these two hacks coexist? I might have to edit the 'edit profile' somehow...
Thanks
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/17/2001 4:16 PM
raiyan, just make the uploads dir be the same as the avatars dir. I think it will be added automatically to the list.
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 05/17/2001 4:32 PM
I don't mean to be picky, but i need them to be uploaded as 00000012.gif or something to that effect and to have the option in the dropdown menu labeled 'uploaded avatar' and show what the user uploaded.
Posted By: SkipperII Re: [6.0x] ELY_M's Upload Modification - 05/17/2001 6:30 PM
I have a many Hack's in my Forum and i must hack it all new or? That ist the Problem...


DerSkipper2000 laugh

Enyone have tested in a older Version?

[ May 17, 2001 11:30 AM: Message edited by: SkipperII ]
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/17/2001 7:19 PM
How much time does it take?
About 15 minutes... And 6.04e fixed many security issues...
If you think it will take more than 15mins, use Beyond Compare.
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 05/21/2001 12:58 AM
Quote
quote:
I can get people to upload avatars to the avatar directory, but i need basically what i said. A option in the menu for uploaded avatar and for it to be uploaded as xxxxx23.gif. I'm basically bumping this up.
Posted By: Raimund Re: [6.0x] ELY_M's Upload Modification - 05/21/2001 10:18 AM
and i would to have it like the 5 series version... to limit not only file size but how many files too.
the hack should create a folder for each members that upload something.

i don't want members thrash down my webspace with their pics...


anybody could make this? confused
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/26/2001 12:55 PM
I fixed the upload hack.

if the user happen to try to upload illegal format. the file wont be uploaded at all.

changed the code, so the files wont be copied over the other.

Thank to someone who posted the code.

I also added upload hack to public_edit_post.pl


Redownload the zip and read the instructions.
Posted By: Cobra Re: [6.0x] ELY_M's Upload Modification - 05/27/2001 12:40 AM
Hi, in your documentaion for installing this hack you refer to "public_edit_form.pl" as a file that needs to be edited. I have 6.04e and I do not see this file anywhere.

Am I missing a file or is this a typo?

Thanks,
Cobra
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/27/2001 6:59 AM
It's public_edit_post.pl
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/27/2001 7:22 AM
Thanks for pointing out to my typo in the instructions.

LK is right
I found something you left out of the hack.
This is for UBB 6.0, 6.01, 6.02, 6.03
open cp-lib.cgi
Find:
print FILE qq!FloodCheckSpan => q~$FloodCheckSpan~n!;

Replace with:
print FILE qq!FloodCheckSpan => q~$FloodCheckSpan~,n!;
Posted By: gpyper Re: [6.0x] ELY_M's Upload Modification - 05/29/2001 8:03 PM
Has the file been moved off Tripod I can't seem to download it.

Is this Hack available anywhere else?
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 05/29/2001 8:07 PM
gpyper, the link works, but you can't download it using Getright/DAP, download it in Internet Explorer.
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 05/30/2001 7:17 AM
I been busy with other projects.

I finally updated my zip. it is still at tripod

you have to simple click on the link and you will tripod page with the zip link. just click again.

Just press on left button.
Posted By: Tech-Ni-Kal Re: [6.0x] ELY_M's Upload Modification - 05/30/2001 4:55 PM
This MOD rules !! Thanks very MUCH!
Posted By: gpyper Re: [6.0x] ELY_M's Upload Modification - 05/30/2001 6:27 PM
I have the mod working and all seems fine, however can I retain the name of the document, when I post a word document I would like others to see the same file name.

Is this hard to do?
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 05/30/2001 10:49 PM
updated here to the latest version ELY_M, thanks, works well. smile

Just about ready for the finished forum?
Posted By: Cobra Re: [6.0x] ELY_M's Upload Modification - 05/31/2001 6:24 AM
A bit confused here. I got the hack installed and look like everything was fine. I found the options in the CP / Miscellaneous and Forums. I set all the options and setup up one forum to allow uploads.

However, when I go to that forum and try to post or send a pm I get no option to upload. There's nothing to choose to upload a file.

Here's a link to the forum.

http://www.lwg3d.org/cgi-bin/ultimatebb.cgi?ubb=forum&f=1

Any idea what I did wrong?

Cobra
frown

[ May 30, 2001 11:24 PM: Message edited by: Cobra ]
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 05/31/2001 8:47 AM
check your wordlets, make sure they are done, or you won't get a link.
Posted By: Cobra Re: [6.0x] ELY_M's Upload Modification - 05/31/2001 6:11 PM
Here's what I applied to the "var_wordlets_mods.cgi" file:

At the beginning:

%vars_wordlets_mods = (

Uploads_Upload Here => q~Uploads~,


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


Just before the end of the file:


upload_link => q~Upload File Form~,
upload_size_limit_title_bar => q~Error: Limit Reached~,
upload_submit_button => q~Upload~,
upload_not_allowed => q~File Uploading is not allowed in this forum.~,
upload_not_allowed_pm => q~File Uploading is not allowed in private messages.~,
upload_allowed_files1 => q~file formats allowed:
~,
upload_allowed_files2 => q~extenisons
you cant upload any file formats that are not listed here~,
upload_finished_title_bar => q~Upload Finished~,
upload_file_name_dontworry => q~upload_file_name_dontworry~,
upload_illegal_title_bar => q~Illegal File Format (extension)~,
upload_illegal_message1 => q~You can not upload this file format ~,
upload_illegal_message2 => q~

please upload a different file or Do not upload at all.~,
upload_size_limit_header => q~

File Size Limit Reached

~,
upload_finished_header => q~

Upload Finished

~,
upload_illegal_header => q~Illegal File Format (extension)~,
upload_finished_link => q~Here is the link to your uploaded file.
~,
upload_copy_paste => q~copy and paste this in your message~,
upload_size_limit => q~The file size limit is~,
upload_rules => q~uploading rules:
no viruses, trojans, or warez allowed
if you abuse it. It will be disabled by Admin

~,

);
1;

Documentation regarding "_ => ""," were not very clear so I may not have made changes in this matter correctly hence "Uploads_Upload Here => q~Uploads~," at the beginning if the file is probably my error.

Thanks for your help.
Cobra
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 05/31/2001 6:45 PM
Usually the first part of the wordlet line is all lowercase... check that, and you don't have to seperate them out, you can put them all together or in different places, as long as they are there.
Posted By: Cobra Re: [6.0x] ELY_M's Upload Modification - 06/01/2001 1:47 AM
I cnahged em to lower case and still won't show up. I'll try reinstalling the hack and see if I can pick up an error somewhere on my part elsewhere.

If that doesn't work maybe I can get you to look at my ubb?

Thanks again,
Cobra
Posted By: Cobra Re: [6.0x] ELY_M's Upload Modification - 06/02/2001 8:31 AM
frown

I reinstalled the hack and it still doesn't work but I did get some different results and possible some new info.

First I need to mention that I am installing this on 604e.

Everything appered to be just the same after the reinstall untill I added the following files after hacking them.

cp_common.pl
cp_wordlets.cgi
cp.cgi
ultimatebb.cgi

What caused the problem was something in Step 3 of the mods_wordlet_install.txt instructions. I realized after reinstalling the hack that I had missed this part on the last hack. I was unable to determine which of the scripts caused the problem but what I get is an internal server error.

When I looked at my log I believe this is the problem with both the cp.cgi and ultimatebb.cgi

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

httpd: [Sat Jun 2 00:05:11 2001] [error] [client 204.228.206.203] Premature end of script headers: /www/amisite/cgi-bin/cp.cgi
failed to open log file
fopen: Permission denied
httpd: [Sat Jun 2 00:05:14 2001] [error] [client 204.228.206.203] Premature end of script headers: /www/amisite/cgi-bin/ultimatebb.cgi

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

Any ideas?

Thanks,
Cobra
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 06/03/2001 4:53 AM
Quote
quote:

I have better idea, but Im not sure of how to get the script to work like that.

if someone uploaded same filename. it should add a number to end of filename.

image.jpg
image1.jpg
image2.jpg

This is better idea.

I will work on this later.
Posted By: heretic Re: [6.0x] ELY_M's Upload Modification - 06/04/2001 5:18 AM
esh...reading this I'm suprised you're not sick of the support- only thing is I have an issue I have no idea what is wrong. here's a direct link to the post screen, if you click it, it says that there is no page, however the dir is there:

http://www.warpstorm.com/cgi-bin/ultimatebb.cgi?ubb=newtopic&f=2

it says the page doesn't exist. the files are there, chmodded right, hack works.....I'm at a loss.

the upload dir is:

http://www.warpstorm.com/ubb/uploads/
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 06/04/2001 3:58 PM
I got page forbidden from your uploads link.

I think it have to do with your server's options on directory listing.

try put index.html and see what happened.
Posted By: heretic Re: [6.0x] ELY_M's Upload Modification - 06/04/2001 5:35 PM
Still getting that the page doesn't exist. I'll try and have it link directly, but permissions are fine.

This is strange- everything should work, but it's not mad
Posted By: poorapagal Re: [6.0x] ELY_M's Upload Modification - 06/04/2001 5:58 PM
Lovely script, but the path isn't showing on mine, which file do i got to fix the paths to the upload directory as it's not showing on the CP even after the cache clearup
When I try to upload an invalid file type it says invalid file type but it still uploads.
Posted By: e@sy Re: [6.0x] ELY_M's Upload Modification - 06/04/2001 9:46 PM
If i upload .zip files the files are damaged.

Any ideas ?
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 06/06/2001 4:27 PM
it should not mess up your zip files.

about invalid file. you have to get newest instructions and re-do your hack.

just download newest zip smile
Posted By: yosco Re: [6.0x] ELY_M's Upload Modification - 06/08/2001 8:23 PM
A little help with paths

Can someone give me examples of these:
I just can't figure out what paths to put.

DIR path to the uploads folder

URL path to the uploads folder

[ June 08, 2001 01:25 PM: Message edited by: yosco ]
Posted By: freeTV Re: [6.0x] ELY_M's Upload Modification - 06/09/2001 9:49 PM
It's wherever you created your upload directory... For example, if your absolute path to the upload directory is:

Quote
quote:
Then, that's your DIR path to the upload folder.

And your URL to the upload maybe:

Quote
quote:
Also remember to create a directory caled "upload" in the absolute path above.

[ June 09, 2001 02:54 PM: Message edited by: freeTV ]
Posted By: malcomholmes Re: [6.0x] ELY_M's Upload Modification - 06/11/2001 12:39 AM
it all almost works! Im fudging with

When i go to cp and select modifacations wordlets if flips me to this error message


Content-type: text/html
Software error:
syntax error at D:/webs/webdir/mydot.com/cgi-bin/cp_wordlets.cgi line 22, near "elsif" syntax error at D:/webs/webdir/mydot.com/cgi-bin/cp_wordlets.cgi line 50, near "}"


im gonna keep hacking at it like i did with who's online. I got that working,I will keep trying.Maybe i can get lil feedback on this error.
Posted By: stupidboy.com Re: [6.0x] ELY_M's Upload Modification - 06/19/2001 10:17 PM
I followed the instructions to the "T" and checked and checked for something I might have missed. Here's my issue.

Everything is installed. The wordlet for the uploads doesn't show up.

The misc setting are all configured properly. I specified which forums should have the ability to upload. I cleared the cache and still nothing shows up for either the PM or in the posting.

My board: www.stupidboy.com
UserName: UbbDev
Password: v9UmQa

Does anyone have a clue or am I cursed with mod-install issues?

[ June 19, 2001 03:18 PM: Message edited by: stupidboy.com ]
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 06/19/2001 10:35 PM
StupidBoy, do part 3 of mods_wordlets_install.txt in "mods_wordlets_devkit" directory, especially the ultimatebb.cgi part.
Posted By: KRW Re: [6.0x] ELY_M's Upload Modification - 06/20/2001 8:26 PM
Ive installed this and re-installed it a copule times now. My problem is when I go to forum settings and click on either the yes or no radio button to allow/disallow users posts, it does not save when I update forum settings.

Also, there is not a default choice selected for this radio button, so each time I go back into the forum settings neither the yes nor the no button are selected. What step did I miss here?
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 06/20/2001 8:30 PM
I think you're missing the cp_forum.cgi part.
Posted By: KRW Re: [6.0x] ELY_M's Upload Modification - 06/20/2001 8:54 PM
Thanks LK that was the fix.

New problem now smile
I can upload files and I can see the files in the correct directory on the server. When I click on the link in the post though, I get a file not found error. Any clues on this one?
Posted By: KRW Re: [6.0x] ELY_M's Upload Modification - 06/20/2001 8:58 PM
nm guys, solved my own problem.
Posted By: stupidboy.com Re: [6.0x] ELY_M's Upload Modification - 06/20/2001 9:02 PM
believe it or not, my problem was an extra illegal character which prevented the line in UBB to be read correctly.

I did have a request though. WOuld it be possible to have this file create a dir for each member who uploads so that there isn't a huge disorganized list of files in the main upload directory?

Additionally, I think it would really smooth to be able to choose between the image link being a link or an image reference so that it will show up in their posts.

[ June 20, 2001 05:32 PM: Message edited by: stupidboy.com ]
Posted By: Childboy Re: [6.0x] ELY_M's Upload Modification - 06/22/2001 4:49 PM
please make the code in cp_lib.cgi so that it will be compatible with urls with a tilde(~) in it. (ie. mine's http://cgi-bin.spaceports.com/~tfe/ultimatebb.cgi)

for now i have to manually put an extra "" before it so it won't give me a syntax error but it still doesn't work as it returns a 500 error when i attempt to upload. Uploading will not be a problem because I've installed Avatar hack with uploading working.

[ June 22, 2001 09:52 AM: Message edited by: Childboy ]
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 06/25/2001 5:40 AM
Alright, something changed along the way, because i just installed it and now it uploads as a number.

Now is it possible to be able to upload the picture according to the member's number who is uploading it? This would be incredibly cool and would solve the custom avatar problem. Maybe...

If this is not possible, how do i go back to uploading as the name not number?

Thanks.
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 06/26/2001 2:28 AM
*bump*

I just need the fix to make the upload to be the member's number, not a misc. number.
Posted By: Alex Carr Re: [6.0x] ELY_M's Upload Modification - 06/28/2001 5:52 PM
Anyone had an issue where the image uploads but is corrupted in the process?
Have checked the file in the destination directory and it has a slightly larger size than the original but is corrupted.
Usually the corruption in GIFs is in the form of only showing the first 15 or so pixels worth of height though all of the width. In JPGs its all over the place!
I'm using 6.04d on an NT4 Server. I'd use 6.04c if I could but its no longer available on the Infopop site.
Hope people are still reading this thread! smile
Posted By: dizturbd Re: [6.0x] ELY_M's Upload Modification - 06/29/2001 1:08 AM
I installed everything, and even double checked, but when i goto the upload form, and try to upload something this is what i get

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


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


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

How do i fix this? Or does anyone know what's wrong????????????PLZZZ HELP MEEEEEEEEEE confused
Posted By: imoverick Re: [6.0x] ELY_M's Upload Modification - 06/29/2001 6:50 AM
I installed your hack of upload for UBB6 in my UBB6 6.04f.

I can view the upload form and upload files successfully, but all the files sent are corrupted and cannot be viewed.

I checked the files in FTP and saw their existence, but they are corrupted.

The file I sent was smaller than what I set.
so, the size is ok.

ANyone knows why?
Posted By: Alex Carr Re: [6.0x] ELY_M's Upload Modification - 06/29/2001 11:01 AM
My problem is exactly the same as imoverick's. Just a thought but maybe its something to do with the file size limit not being correctly understood or corruption after of the file after a set amount of Kb have been read? If I upload a GIF the corruption is represented by just the first few lines of the image being displayed, however with a JPG the whole image is there just completley jumbled up. Now if the encoding of JPGs is done by defining the file size (in pixels) within the first few bytes or KB, then running the algorithm for the colors would this not correlate with the theory that somehow the upload section is just corrupting things after a set amount of Kb have been read but continuing to upload the rest of the file? Imoverick, what platform are you running? I'm on NT4 Server SP6.
Posted By: imoverick Re: [6.0x] ELY_M's Upload Modification - 06/29/2001 3:09 PM
dear alex
my server platform is also NT4, but don't know the exact version of SP.
Do u test it in the UNIX platform?
I like this function very much. if cannot run, i think i need to change the server.... ...
Posted By: ScottRoberts Re: [6.0x] ELY_M's Upload Modification - 07/05/2001 9:13 PM
I get the same "500 Internal Server Error" as dizturbd and the others when I try to upload something...

I've checked the perl path, uploaded all the files in ASCII, chmoded the upload.cgi and upload_form.cgi to 777, checked my upload directory's path, chmoded the upload directory to 777, and on and on...I've double, triple, and quadruple-checked everything and no stone was left unturned.

This is the first hack that I've ever had ANY trouble with, and I've been adding hacks to 5.x and 6.x boards for nearly a year. It's baffling to say the least. frown

It seems like this thread's close to dyin' out, or at least very unlikely that it will attract much more attention. That having been said, is there anyone who could shine some light on what else might be causing these problems?
Posted By: ScottRoberts Re: [6.0x] ELY_M's Upload Modification - 07/05/2001 10:42 PM
Well, I grabbed my older backed-up files and tried to install this hack from scratch again. The results...I got the same errors again.:(mad

Then, just on a hunch, I chmoded the upload.cgi and upload_form.cgi to 755. Guess what? The damn thing actually worked this time!

I looked back at the readme file (for the umpteenth time), and found this mistake:

Quote
quote:
ELY, you might want to change this to say 755, so others don't pull their hair out trying to get this thing to work. Other than this small error, this is a good hack. smile
Posted By: MW Re: [6.0x] ELY_M's Upload Modification - 07/06/2001 6:47 PM
Can someone tell me what the hell upload_file_name_dontworry is?
I see that below the text box when I've uploaded a file...

Also when I upload an illegal file format, it will say:
Illegal File Format (extension)

Shouldnt "extension" be the actual extension? (e.g. "zip") or is it suppose to be like this?

Thanks
Posted By: Troy Re: [6.0x] ELY_M's Upload Modification - 07/07/2001 3:38 AM
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.
Posted By: Dave_L Re: [6.0x] ELY_M's Upload Modification - 07/11/2001 12:15 AM
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 ]
Posted By: Alex Carr Re: [6.0x] ELY_M's Upload Modification - 07/12/2001 8:03 PM
Thanks dave_L!!
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/13/2001 1:39 AM
Yup, that definantly works. Thanks Dave! That should be added cause I am sure there are a fair amount of windows users out there.
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/13/2001 1:41 AM
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!
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/13/2001 10:50 PM
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 ]
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/13/2001 11:20 PM
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.
Posted By: humble [ThC] Re: [6.0x] ELY_M's Upload Modification - 07/14/2001 2:02 AM
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!!!!
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 07/14/2001 4:39 AM
Hey james lewis, do you think it's possible to upload as the member number?
Posted By: humble [ThC] Re: [6.0x] ELY_M's Upload Modification - 07/14/2001 5:54 AM
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.
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 07/14/2001 6:59 PM
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!
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/15/2001 4:50 PM
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 ]
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/15/2001 4:57 PM
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 ]
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 07/15/2001 11:37 PM
I'm trying to test it out, but i keep getting this.

Quote
quote:
Should i just delete this part?
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/16/2001 9:33 PM
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 ]
Posted By: Brett Re: [6.0x] ELY_M's Upload Modification - 07/16/2001 11:27 PM
That was the problem! Works like a charm! Thanks a million!
Posted By: humble [ThC] Re: [6.0x] ELY_M's Upload Modification - 07/17/2001 7:00 AM
Hmmm. Only thing I can think of is this (and it is a blanket fix approach... )..

What did this fix?
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 07/17/2001 9:15 AM
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";
Posted By: James Lewis Re: [6.0x] ELY_M's Upload Modification - 07/17/2001 6:14 PM
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.
Posted By: Dino Re: [6.0x] ELY_M's Upload Modification - 07/18/2001 5:11 AM
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.
Posted By: Degen Re: [6.0x] ELY_M's Upload Modification - 07/18/2001 10:51 AM
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
Posted By: Degen Re: [6.0x] ELY_M's Upload Modification - 07/18/2001 11:00 AM
Nevermind, I seemed to have fixed it smile Great hack!
Posted By: Ta Lun 3 Re: [6.0x] ELY_M's Upload Modification - 07/18/2001 7:49 PM
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 ]
Posted By: Dino Re: [6.0x] ELY_M's Upload Modification - 07/20/2001 6:26 PM
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.
Posted By: Dave_L Re: [6.0x] ELY_M's Upload Modification - 07/21/2001 4:55 AM
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.
Posted By: Dino Re: [6.0x] ELY_M's Upload Modification - 07/21/2001 8:25 PM
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?
Posted By: Dave_L Re: [6.0x] ELY_M's Upload Modification - 07/22/2001 2:12 AM
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.
Posted By: ELY_M Re: [6.0x] ELY_M's Upload Modification - 07/24/2001 12:57 PM
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 ]
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 07/24/2001 1:50 PM
ELY_M: (I think)
Code
code:

[ July 24, 2001 07:00 AM: Message edited by: LK ]
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 07/26/2001 6:12 PM
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
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 07/26/2001 6:32 PM
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.
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 07/26/2001 6:36 PM
that might help, I am sure ELY_M welcomes the bugfixes smile
Posted By: LK Re: [6.0x] ELY_M's Upload Modification - 07/26/2001 6:44 PM
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 ]
Posted By: AllenAyres Re: [6.0x] ELY_M's Upload Modification - 07/26/2001 7:21 PM
seems to be working fine now LK, thanks for the help smile
Posted By: import Re: [6.0x] ELY_M's Upload Modification - 07/26/2001 11:31 PM
have been looking for this a long time! works great for 6.04f also. Thanks alot!!!!!!!! laugh smile
Posted By: zorroman Re: [6.0x] ELY_M's Upload Modification - 07/31/2001 11:32 PM
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
Posted By: Dino Re: [6.0x] ELY_M's Upload Modification - 08/05/2001 10:12 AM
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 ]
Posted By: Dino Re: [6.0x] ELY_M's Upload Modification - 08/09/2001 5:47 AM
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?
Posted By: freeTV Re: [6.0x] ELY_M's Upload Modification - 08/25/2001 4:10 PM
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
Posted By: Mike Bobbitt Re: [6.0x] ELY_M's Upload Modification - 03/22/2004 3:51 PM
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
Posted By: Eric Flyxe Re: [6.0x] ELY_M's Upload Modification - 03/22/2004 4:25 PM
LK - the link doesn´t work.

The link in the first post doesn´t work either.

Where can I download it, and will it work for 6.7.0?
Posted By: Ian Spence Re: [6.0x] ELY_M's Upload Modification - 03/22/2004 5:46 PM
I'm working on the 6.7 version, will be done eventually.
© UBB.Developers