/    Sign up×
Community /Pin to ProfileBookmark

Need to browse for files…….

I have a tabular form that takes a title and a filespec for each row. A user will enter the title, but expecting them to correctly enter multiple filespecs is unlikely to be successful.

So, while in their browser, on the form, I’d like the user to be able to browse their local system and select a full file specification (that means filename AND path) that can be sent back to php for storage in a database. Since there may be several rows entered or edited, each column from the form is an array (title is an array, filespec is an array)…

It appears that input type=”file” WILL NOT WORK for two reasons:

  • 1. I’m told I cannot get the full file specification, just the filename back to php.

  • 2. I cannot populate the field on the form with the previously entered file specifications. I’ve been told the lack of default population is because of a security risk.
  • I figure I can’t be the first person ever to need to give users the ability to see and change the previously entered filespecs, browse to get a file from their local system, put the full filespec in a field on a form, and have it passed back to php for processing. So, how do I do this?

    to post a comment
    HTML

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @dkperezauthorJan 20.2010 — I found an example that purports to work at:

    http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom

    Unfortunately, I know even less about javascript than I do about php, but in my testing I seem to have the same problem here I have with php...... In this case, I don't seem to be able to get ANYTHING to go from the html form to php, and I ALSO don't appear to be able to put a default value in the field...

    Is this just another thing I can't do in javascript, either?
    Copy linkTweet thisAlerts:
    @FangJan 20.2010 — The link only shows how you can style the file input control.

    As for your problem; only with IE can you read the path, but not write it to the file control. All other browsers don't allow this, or even hide the path from the user.
    Copy linkTweet thisAlerts:
    @dkperezauthorJan 21.2010 — OK, I still need a solution. This can't be the first time in the history of the Internet that someone wanted to get files to email from the client. So how DO I do it?
    Copy linkTweet thisAlerts:
    @criterion9Jan 21.2010 — This was answered in your other thread.
    ×

    Success!

    Help @dkperez spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...