www.webdeveloper.com
Results 1 to 4 of 4

Thread: File Upload (not selected by user)

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Posts
    20

    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.


    Thanks,

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,270
    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
    Posts
    20
    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
    Location
    localhost
    Posts
    2,213
    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.
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

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