Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7530461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:55:04+00:00 2026-05-30T04:55:04+00:00

So as it stands I have a form that hands a file to my

  • 0

So as it stands I have a form that hands a file to my server. What I am interested in doing is sending only the files full name to the server. Currently, my code is as follows:

<form action="upload.php" method="POST" >
    <table align="center">
        <tr>
            <td align="right">
                Select your file to upload:
            </td>
            <td>
                <input name="userfile" type="file" size="50">
            </td>
        </tr>
    </table>
    <table align="center">
        <tr>
            <td align="center">
                <input type="submit" name="submit" value="Upload image" />
            </td>
        </tr>
    </table>
</form>

When the form passes to upload.php, the value I get for $_POST[‘userfile’] is the ‘name’ of the file I am handing up. I am looking to get the full path out of this field, rather than just a filename. I wonder if anyone has any recommendations for a client-side file browser that can hand this back, or perhaps another way to evaluate this form to get that data, I would greatly appreciate it. I’ve tried adding ‘enctype=”multipart/form-data”‘ to the form definition, and what is actually really surprising is that I don’t get any form info on my upload page – which is an entirely different problem. Anyway, thanks for any help.

Edit

Elaborate on my question…
I’m trying to upload large files to my web server. HTTP Forms break after 100 megs or who knows. FTP is difficult to manage on 30 systems with 10 different users that have no idea how to determine why their client can’t connect. I’m writing a web form to upload files to my server when these people are done with them. I am trying to find a solution to do this. The above script, is supposed to hand my full file path to the following script:

<?
set_time_limit(300);

var_dump($_FILES);
var_dump($_POST);
$filep=$_POST['userfile'];
$name=$_POST['userfile']['name'];

echo($filep);
echo($name);
$paths="test";
$ftp_server="localhost";
$ftp_user_name="digitaljedi";
$ftp_user_pass="dontworryaboutit";

// set up a connection to ftp server
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection and login result
if ((!$conn_id) || (!$login_result)) {
    echo "FTP connection has encountered an error!";
    echo "Attempted to connect to $ftp_server for user $ftp_user_name....";
    exit;
} else {
    echo "Connected to $ftp_server, for user $ftp_user_name".".....";
}

// upload the file to the path specified
$upload = ftp_put($conn_id, $paths.'/'.$name, $filep, FTP_BINARY);

// check the upload status
if (!$upload) {
    echo "FTP upload has encountered an error!";
} else {
    echo "Uploaded file with name $name to $ftp_server ";
}

// close the FTP connection
ftp_close($conn_id);    

?>

If I add an encoding type to the form, I end up with NO $_POST data, and NO $_FORM data in upload.php, but rather, undefined indexes to ‘userfile’. As it sits; If I upload say… ‘C:\users\digitaljedi\wtf.txt’ – I end up with ‘wtf.txt’ on the other end.

…..

I just tried adjusting my PHP to use a static path, rather than one from the form, and I end up not being able to open the file anyway. Apparently ftp_put uses the server filesystem, which completely negates my entire theory here.

Now what I want to know is this; is there NO solution for uploading large files through a web page? I found a flash uploader, but it seems to be capped at 100 megs ( documentation says that this is all flash allows ). This is becoming more trouble than it’s worth.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T04:55:05+00:00Added an answer on May 30, 2026 at 4:55 am

    You’re uploading a file:

    Firstly, in your form, submit it with <form> as:

    <form enctype="multipart/form-data" action="uploader.php" method="POST">
    

    Secondly, use the $_FILES variable!

    $_FILES['name_of_file_field']['name']
    

    That gives you the original file name – change name_of_file_field to match the name of the file input field, you used userfile so change it to that.

    If they are uploading files that are 100MB+, then just change the memory size limit to accept greater-sized files:

    // Set the timeout to be longer to allow the file to upload, a value in seconds (3600 = 1 hour)
    set_time_limit(3600);
    
    // Set these amounts to whatever you need (1M = 1MB)
    ini_set("post_max_size", "1000M");
    ini_set("upload_max_filesize", "1000M");
    
    // Generally speaking, the memory_limit should be higher than your post size.  So make sure that's right too.
    ini_set("memory_limit", "1100M");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple login form in my website. In given requirements stands, that password
I have been optimizing my website but the one problem that stands in my
As it stands, I have a deserialiser that can import any model I throw
I have a form that I want to be used to add entries. Once
I have a form that submit a shopping cart to Google Checkout. The form
I have this form set up on my website: http://cssrevolt.com/upload/files/protoform/ It's all customized and
MVC3 VB.NET Application. I have multiple file upload boxes on a form in my
I have a form submit button that I need to enable the user to
I have a question about forms. I have a fairly standard form that saves
I have a WPF form that takes a list of objects that have locations

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.