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 6553033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:31:57+00:00 2026-05-25T12:31:57+00:00

I’ve created a HTML and PHP form to pretty much just input data into

  • 0

I’ve created a HTML and PHP form to pretty much just input data into a MySQL table.
I’ve got a file upload field, but it doesn’t upload a file. I don’t want it to upload anything to the server, all I want is for it to grab the location of the file selected and input that into the database.

It works perfectly fine on Internet Explorer, but doesn’t work on any other browser, I assume it’s because of security issues it imposes.

My input code:

<input type="file" id="filename" name="filename" />

And of course when the form is submitted some PHP code runs through to insert the data into the database. I’ve tried JavaScript to copy value of that field to to another field but again because of security issues that doesn’t work.

Does anyone know of a way I can do this in JavaScript? Or even Flash? To be honest, anything similar to these would do, just something that works in browsers other than IE.

Thanks.

EDIT –

Here’s my code:

<?php
if (isset($_POST['submit'])) {
    $name = addslashes(htmlentities($_POST['name']));
    $filename = addslashes(htmlentities($_POST['filename']));

    if (@mysql_query("INSERT INTO movies SET
                      name='$name',
                      doc_filename='$filename'")) {
        echo '<p>Movie added.</p><p><a href=movies.php">Manage movies</a>.</p>';
    } else {
        echo '<strong>Error:</strong> '.mysql_error().'';
    }
} else {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="newspost" enctype="multipart/form-data">
    <div class="form-row">
        <label for="fm_title">Movie file path: </label><br />
        <input type="file" id="filename" name="filename" />
    </div><br />
    <div class="form-row">
        <label for="fm_title">Movie name: </label><br />
        <input type="text" class="input-width" name="name" value="<?php if (!empty($_POST['name'])) { echo $_POST['name']; } ?>" />
    </div>
    <div class="form-row">
        <input type="submit" name="submit" value="Submit" />
    </div>
</form>
<?php
}
?>
  • 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-25T12:31:57+00:00Added an answer on May 25, 2026 at 12:31 pm

    all I want is for it to grab the location of the file selected and input that into the database.

    This is no longer possible using HTML – for security reasons, the location of the selected file is not accessible in the file input’s DOM element anymore. Most browsers use C:\Fakepath\ instead.

    You might be able to get hold of this information using a Flash or Java based uploader (edit: see e.g. this page in the AS3 manual) SWFUpload’s API could be worth a look. It could be that you need to build your own Flash or Java solution for this, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I need to clean up various Word 'smart' characters in user input, including but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i want to parse a xhtml file and display in UITableView. what is the

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.