View Full Version : [RELEASE] Image upload
I don't recall seeing this done exactly this way before. If it has been, I apologize to the author.
Anyway, what this will allow a user to do is upload a file to your webserver that they can insert into their post. It's modelled after the old UBB image upload hack.
Please keep in mind that this was a quick and dirty hack job, and I wasn't making it with the intentions of releasing it.
You can specify the maximum file size that you'd like to use - that's about it as far as security goes.
Here's the file:
http://www.bronx-bombers.com/forums/hacks/image_upload.zip
Here's an example:
http://forums.bronx-bombers.com/
Hope someone will find this useful :).
-jim
Excellent I always wanted a hack like this one instead of the image gallery that limits the user to one upload!
nice one..:)
but can we configure to accept other files format too?
and it will show only file links if it is not image file
Originally posted by ahbao
nice one..:)
but can we configure to accept other files format too?
and it will show only file links if it is not image file
No, but this feature will be part of vBulletin 2.0. It can upload anything - it's the displaying the link that isn't part of this hack. Feel free to manipulate the code any way that you want, however.
-jim
I'm using .php3, shall I rename the files only?
Thanks :)
Yes, just rename the files, and be sure to change the form action in the upload template as well.
-jim
I setup the stuff as instructed, now when I open that new window upload.php3 - I get this error:
Fatal error: Call to unsupported or undefined function upload_file() in /home/truthugs/forum/upload.php3 on line 4
What did I do wrong ?
The upload.php3 ONLY has 4 lines.. haha
<?
require("global.php3");
eval("echo upload_file();");
?>
[Edited by Fred on 12-18-2000 at 09:05 PM]
Fred, did you add the upload_file function to global.php as specified in the install.txt file?
-jim
Fred does your server run php on safe mode?
I found out the problem, I edited the file on my HD (global.php3), but I forgot to upload it. A simple mistake that caused the problem.
Anyways, so that part worked. And I made a dir in my forum dir called 'pictures'. I chomd it to 777 like I was told to.
But when I browse for an image, and then try to Upload it, it brings me to this:
// This is the script that takes the form values and uploads the image to the server. Illegal file type. Only files with .jpg and .gif extensions can be uploaded.
Please click here to go back and try again.
Any idea whats that from?
Did you rename upload_file.php to upload_file.php3?
Yes, and it's uploaded too ;)
Wonder why it dont work.. i edited upload_file.php3 inside.. was i supposed to?
If so, what was I supposed to edit exactly..?
Even though the images are gif or jpg, I am getting this error and am not able to upload images. I am running vB 1.1.4 and PHP4
Thanks
-Hideki
Thats my problem too. JimF, please help me with this. The hack looks fantasic so far, I've got it on my pages and everything. The popup comes up, I can browse for an image (jpg or gif) and when I upload, that gay illegal gay comes up.
What EXACTLY do I edit in upload_file.php3 when I'm manually editing it in my Frontpage?
hey hows it going
just a small question
when adding the max file size in:
$filesize = "300"
do you make it 300kb or leave it as 300
when i try both it comes up with this error:
// This is the script that takes the form values and uploads the image to the server. Your file is too large. Please click here to go back and try again.
let me know if i am doing anythgin wrong
thanks
Does it support Image Upload enabled only in selected forums?
what should i do if my serveris running in safe mode?
Warning: SAFE MODE Restriction in effect. The script whose uid is 38330 is not allowed to access /tmp/phpC0UJze owned by uid 0 in /web/sites/154/twilightonline/www.twilight-online.f2s.com/forum/upload.php
Contact your host about it. If you are on vservers, then he will take care of it for you. If you are on a dedicated server, thats your job :D
(php noobie alert!)
I must be doing something wrong that is very basic to php. I tried to implement this hack, which is seemingly very simple to implement, and can't even get close. After following the text file, editing the necessary items, I get an INTERNAL SERVER ERROR when I attempt to use it. I have triple checked my edits and everything seems copacetic. I made sure that I uploaded the files using ASCII mode. I have to edit all of my php files and add the following to the top, but that doesn't seem to be it in this instance:
#!/usr/bin/php
<?php
I made sure everything was 777. I just don't know how to debug this. The error message is useless, so I don't know where to start to debug. Does anyone have any ideas?
At the bottom of the error message is the following:
"Apache/1.3.12 Server" so I assume it's a unix box. I get the same error if I go directly to the upload.php or the upload_file.php.
This hack is really messed. I've been trying forever to set it up. It's not sripted right or something, or the version that JimF uploaded is missing some coding inside.
But I'm not going to care about it, a GOOD version of it will come out with the vBulletin version 2.0 :)
Fred Salari
Not support Arabic :(.
becaus it is save the file that i upload as :
nomber&username&filename
And the server well not read Arabic letters becaus our user name in Arabic .
Can we change something in file upload_file.php to let it save the file that i upload As :
nomber&usernomber(serialNo)&file name ?
I hope that ..
Thank you ,,,
[Edited by dellow on 01-01-2001 at 09:52 AM]
Churchi , did you ever get your error resolved , I'm getting that error as well. If you did can you tell me how. Thanks
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.