Error Image Uploading..Please help fixing!

Started on the old forum in May 2009 · view the original in the archive · old links redirect here

1 reply · 491 views · started 17 years ago · 2 min read

2 participants
kiLLeR-eyEd_14 Senior · 382 posts #1

I tried to modify the methos photo gallery for my wapdesire edited script..I've done the gallery.php w/o any error but i can't fix the upload.php..What should be fixed here.. ////////////////////////////////////////UPLOADING AND HANDLING THE IMAGE if ($action=="upload") { addonline(getuid_sid($sid),"Uploading Photo",""); echo "<head>"; echo "<title>Uploading Photo</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo ""; // ---------- IMAGE UPLOAD ----------

// we create an instance of the class, giving as argument the PHP object 
// corresponding to the file field from the form
// All the uploads are accessible from the PHP object $_FILES
$handle = new Upload($_FILES['f1']);

// then we check if the file has been uploaded properly
// in its *temporary* location in the server (often, it is /wap/usergallery)
if ($handle->uploaded) {
    
    // yes, the file is on the server
    // below are some example settings which can be used if the uploaded file is an image.
    $handle->image_resize            = true;
    $handle->image_ratio_y           = true;
    $handle->image_x                 = 200;

    // now, we start the upload 'process'. That is, to copy the uploaded file
    // from its temporary location to the wanted location
    // It could be something like $handle->Process('/root/yujiwap.byethost9.com/htdocs/');
    $handle->Process('../pics_original');
    
    // we check if everything went OK
    if ($handle->processed) {
        // everything was fine !

        echo 'Your Photo has been uploaded successfully!!!

'; echo ' <img src="'. $imgpath . '/' . $handle->file_dst_name . '" /> '; $info = getimagesize($handle->file_dst_pathname); $imageurl = "$imgpath/$handle->file_dst_name"; $reg = mysql_query("INSERT INTO ibwf_usergallery SET uid='".$uid."', imageurl='".$imageurl."', sex='".$userinfo[1]."', time='".time()."', descript='".$descript."'");

    } else {
        // one error occured

        echo 'File hasn't been uploaded to the wanted location!!!

'; echo ' Error: ' . $handle->error . ' ';

    }

    // we delete the temporary files
    $handle-> Clean();

} else {
    // if we're here, the upload file failed for some reasons
    // i.e. the server didn't receive the file

    echo 'File hasn't been uploaded on the server!!!

'; echo ' Error: ' . $handle->error . ''; }

my directories are, root/yujiwap.byethost9.com/htdocs/ then the image folder is ../pics_original

alesh Lead · 604 posts #2

i think this is very wrong.....

$handle->Process('../pics_original');

i think it should be

$handle->Process('/home/DOMAIN/public_html/pics_original/');

eeeeerrr....

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close