Results 1 to 4 of 4

Thread: File Upload (not selected by user)

Hybrid View

  1. #1
    Join Date
    Jun 2005

    File Upload (not selected by user)

    I have an HTML file which is downloaded from my server to my PC. I add entries into various text boxes and then would like to upload the file including the text box values back to my server but in a different folder. I am using localStorage() on my HTML file.

    It seems that all of the PHP scripts I've found for file uploading require the user to select a file on the PC and then upload it. I don't wish to select a file, I just want to provide the file name (my html file) to the PHP script from say, javascript.

    My idea is to simply place an upload.php file on my server and send it the name of my html file.

    I would appreciate it some could provide the essential lines of PHP script to upload a file without user file selection.


  2. #2
    Join Date
    Nov 2002
    Baltimore, Maryland
    This thing that you want to do you cannot do. Or at least you're not supposed to be able to do. Web pages are supposed to exist in a bit of a sandbox to keep malicious pages and evil intent at bay. However, MSIE has lots of security holes. You can pull this off if the page has an HTA filename extension but it'll only work on MSIE and you'll get security warnings.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Jun 2005
    That's too bad. I'm a bit surprised as the PHP file would be on my server and the webpage is not for general consumption but my use only. Anyway, I guess the browser has to cover for all uses.

    Thanks for your reply.

  4. #4
    Join Date
    Mar 2007
    What is wrong with having a HTML page generated using PHP that is a form that is then posted to the server that then uses a script to make a hard copy of your inputs in a HTML page in a folder of your choice.
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles