5

Is it possible to edit a local file without uploading to the browser?

Let's say the client has an HTML file, I want him to be able to use my site's javascript to edit the file without uploading it. Would this be possible?

Thanks.

12
  • 2
    @John - Take a look at HTML5, it is possible now. Commented Jan 1, 2011 at 14:01
  • 1
    @Nick: not in all browsers yet Commented Jan 1, 2011 at 14:44
  • @John - I agree, but "not in all browsers" is a long cry from "no" :) Commented Jan 1, 2011 at 17:49
  • @Nick: not really. If you can't afford to ignore the browsers without the feature, then the answer, in effect, is "NO". Also, BTW, I get the impression that the OP would like to save the file after it's edited. Commented Jan 1, 2011 at 17:57
  • 1
    @John - I completely disagree with your analysis, if for example I'm targeting chrome users the answer is in effect, "YES"...you're making assumptions for all cases here, many will find this question and have very different requirements than you and I on a daily basis. Commented Jan 1, 2011 at 18:27

2 Answers 2

4

Yes, it is possible, but only in HTML5 (and only as browsers add support for it...not all do yet), you can find the HTML5 File API here.

Note that the user has to give permission to access the file, from Section 5.9:

Once a user has given permission, user agents should provide the ability to read and parse data directly from a local file programmatically.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 however, he can't write it back. He'd need something like downloadify for that
2

Nope, that's not possible and shouldn't be either due to security concerns it may pose otherwise.

Note: This feature is there in HTML5 as pointed out by @Nick Craver, you may want to go for but you should be aware of the fact that HTML5 isn't yet supported by all browsers.

1 Comment

@Nick Craver: Not that early yet, HTML5?, far away :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.