Error Image Uploading..Please help fixing!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Error Image Uploading..Please help fixing!

    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 "<center>";
    // ---------- 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!!!<br/>';
    echo ' <img src="'. $imgpath . '/' . $handle->file_dst_name . '" /><br/>';
    $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!!!<br/>';
    echo ' Error: ' . $handle->error . '<br/>';

    }

    // 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!!!<br/>';
    echo ' Error: ' . $handle->error . '';
    }

    my directories are,
    root/yujiwap.byethost9.com/htdocs/
    then the image folder is
    ../pics_original
    My Blog: http://jhommark.blogspot.com
    My Facebook: http://www.facebook.com/jhommark
    My Official Site: http://www.undergroundweb.tk
    My Community Site: http://undergroundwap.xtreemhost.com

    #2
    i think this is very wrong.....
    PHP Code:
    $handle->Process('../pics_original'); 
    i think it should be
    PHP Code:
    $handle->Process('/home/DOMAIN/public_html/pics_original/'); 
    sigpiceeeeerrr....

    Comment

    Working...
    X