Question:

WEBSITE DESIGN helpp?

by  |  earlier

0 LIKES UnLike

ok, a member of the site is trying to upload a file... to be specific it is an audio file. when he does upload, he gets a confirmation. I should be able to go in, see the upload, and then okay or deny it. It never shows up...

I am trying to figure out where the upload is going. Cause it isn't going where I can see it..... help?

 Tags:

   Report

2 ANSWERS


  1. so this website where you are the administrator has the functionality to allow users to upload files to your websites server? Well... the files probably there somewheres, try doing a search for this file on all files from the root directory on down and see if you get any hits, perhaps try searching for any files updated in the last xyz days to see if any have a file name that resembles what your after...  on the other hand... perhaps the server shoots all the users uploaded files off into a relational database and not the file system... pretty common... you will need to get yourself a DB management tool and go looking through all the tables used by your web server to find the one that has the data your lookin for.  Look at the source code... it tells no lies.


  2. Second time you ask that question!

    You obvioulsy did not write the code for the file upload, otherwise you would KNOW where uploaded files are going on your server.

    My guess is that you used a free script you do not understand or you did not adapt correctly.

    You MUST have, somewhere in that code, some CONSTANTs or VARIABLEs that define the path of your uploaded files, something like

    "$uploadir = 'mysite/uploadedfiles' ";

    AND you MUST create that directory on your server,

    AND you must set the permissions for that directory to be 0777.

    Your script is also probably badly written: it does not warn you if something goes wrong during the upload!

    File uploads are NOT easy to achieve: there are many little things that can go wrong (That's why so many free scripts are badly written).

    Start with the code in a text editor and try to understand it.

    The first thing to look for is the FORM that allows to select and upload a file.  That form MUST have the following parameters-arguments:

    <form name = ' fupload ' enctype = ' multipart/form-data ' action = ' upfiles.php ' method = ' post ' > " ;

    Note the enctype: this is essential!

    Then:

    <input type = ' file ' name = ' file1 ' size = 20 />

    to force the selection of the file

    The form is then submitted to the server-side script "upfiles.php": this is the script that will receive the file and do something with it!

    In the body of upfiles.php, you have something like:

    if ($_FILES['file1']['name'] != "")

    {

    $res = UploadOne($_FILES['file1']);

    $filname = $_FILES['file1']['name'];

    unset($_FILES);

    echo ($res);

    }

    This will call the upload function:

    function UploadOne($fname)

    {

    $uploaddir = 'uploadedfiles/'; -> THIS is where the files will be stored!

    if (is_uploaded_file($fname['tmp_name']))

    {

    $tmpname = $fname['tmp_name'];

    $filname = basename($fname['name']);

    $type = $fname['type'];

    $siz = $fname['size'];

    $uploadfile = $uploaddir . basename($fname['name']);

    if (move_uploaded_file ($fname['tmp_name'], $uploadfile))

    $res = "File " . $filname . " was successfully uploaded and stored.
    ";

    else

    $res = "Could not move ".$fname['tmp_name']." to ".$uploadfile."<br>";

    }

    else

    $res = "File ".$fname['name']." failed to upload.";

    return ($res);

    }

    Again, don't forget to create the directory "uploadedfiles" and set permissions to 0777...

    Good luck!
You're reading: WEBSITE DESIGN helpp?

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.