Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, Upload images using the datamanager in vBulletin; Upload images using the datamanager Hey, In this tutorial I'll try to show you how you can upload images using ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=11089


Reply
LinkBack Thread Tools Display Modes
Upload images using the datamanager
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
28-12-2008, 04:34 PM
 
Upload images using the datamanager

Hey,
In this tutorial I'll try to show you how you can upload images using the vb datamanaging class.

First of all you have to make a special form to upload images.
Like this:
HTML Code:
PHP Code:
<form method="post" enctype="multipart/form-data" action="portfolio.php">
<
input type="hidden" name="do" value="doupload" /><b>Upload new image:</b><br />
<
input type="file" name="upload" />
<
br />
<
input type="submit" value="add" />
</
form>

So make sure you have this:
<form method="post" enctype="multipart/form-data">
and <input type="file" name="upload">

then you can create a php file to process the upload.
like this:

PHP Code:
PHP Code:
if($_POST['do']=="doupload"){
$vbulletin->input->clean_gpc("f","upload",TYPE_FILE);
require_once(
'./includes/class_upload.php');
require_once(
'./includes/class_image.php');
$upload = new vB_Upload_Image($vbulletin);
$upload->image =& vB_Image::fetch_library($vbulletin);
$upload->path = "./image/misc/";
if (!(
$upload->process_upload($vbulletin->GPC['upload']))){
        eval(
standard_error(fetch_error('there_were_errors_encountered_with_your_upload_x', $upload->fetch_error())));
    }
}

So this:
$vbulletin->input->clean_gpc("f","upload",TYPE_FILE); cleans the file
$upload->path is the path to where the image has to be uploaded
$vbulletin->GPC['upload'] is the file containing ($vbulletin->GPC['upload'][x]):
-name: The name of the image
-type: the mime type of the image, like: image/gif
-tmp_name: the temporary name when the image is uploading
-size: the filesize in bytes
__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Articles Thread, Upload images using the datamanager in vBulletin; Upload images using the datamanager Hey, In this tutorial I'll try to show you how you can upload images using ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=11089


Bookmarks

Tags
datamanager, images, upload


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing background from images Alex Ross Photoshop 2 20-11-2008 01:09 AM
Egypt Web Upload Files Script V1.0 Developer PHP 2 14-11-2008 10:06 PM
HTML Images Developer Articles 0 28-10-2008 07:20 PM
Search and Quicklink Images Developer Mods for 3.7.x 0 12-09-2008 04:48 AM
Creative Portfolio (1st Upload) Developer Web Application 0 04-09-2008 10:58 PM