GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   Need a Help with Form (https://gfy.com/showthread.php?t=1119169)

srockhard 08-23-2013 11:28 AM

Need a Help with Form
 
My form works great but I can't get the user submitted images to save to my server or display in the email that I receive once form is submitted. What is wrong here:

Code:

    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp", "png");

    //Get the uploaded file information

    $name_of_uploaded_file =  basename($_FILES['photo']['name']);

    //get the file extension of the file

    $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1);

    $size_of_uploaded_file = $_FILES["photo"]["size"]/1024;//size in KBs   

    //copy the temp. uploaded file to uploads folder

    $path_of_uploaded_file = $_SERVER['DOCUMENT_ROOT'] .'/' . $name_of_uploaded_file;

    $tmp_path = $_FILES["photo"]["tmp_name"];

    if(is_uploaded_file($tmp_path))

    {

      if(!copy($tmp_path,$path_of_uploaded_file))

      {

        $errors .= '\n error while copying the uploaded file';

      }

    }


fendlestick 09-01-2013 04:10 PM

Didnt read the code, but maybe the issue is with your upload folder permissions as they always sux.

AMSM 09-26-2013 09:20 AM

double check the words 'photo' 'name' and 'size' are the same words as in the html on the front end form, that usually gets me.

nin 10-16-2013 04:47 AM

do not try to check all the code, find the place where you loose your file -

from the begining:
die($name_of_uploaded_file); will give you the name of the file or you are not receiving it on the server at all?

if you have the file - try to use "move_uploaded_file"

include all the checkings, renamings, filters only after you will solve the main problem - getting your file in the place it should appear.


All times are GMT -7. The time now is 12:41 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123