Updating a file online on browser

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
softsolvers
Forum Commoner
Posts: 75
Joined: Fri Feb 13, 2004 4:26 am
Location: India

Updating a file online on browser

Post by softsolvers »

Hi fellows
I have a query, I am opening the .txt file on the browser, now i want to modify means type somthing on that file ,and i want to save that file by clicking on a button ,Is it possible.
I mean i want to save a file online,I open a .txt,.doc etc file type some text on that and save it just by clicking on he button.
Hope u will help me.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Of course it is. Open the txt file up and place the content of it in a form (<textarea>*content of file*</textarea>), then let the user edit this form to his/her hearts content. Then submit the form, and simply write the content of the textarea back into the file.

Simple as that!
User avatar
softsolvers
Forum Commoner
Posts: 75
Joined: Fri Feb 13, 2004 4:26 am
Location: India

Post by softsolvers »

Thanks but is was asking that can i update any type of file on the browser itself
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

Any type of file? No, not really - you couldn't (easily!) edit say a GIF file or a Word document for example.
User avatar
softsolvers
Forum Commoner
Posts: 75
Joined: Fri Feb 13, 2004 4:26 am
Location: India

Post by softsolvers »

What is the reason, is it requires some browser configuration,
Please tell me the reason?
User avatar
launchcode
Forum Contributor
Posts: 401
Joined: Tue May 11, 2004 7:32 pm
Location: UK
Contact:

Post by launchcode »

Err... because web browsers are just that - browsers. They're not built for editing extremely rich content like that.

You can edit a text file easily, heck you *might* be able to edit a Word document via something like HTMLarea (search Google for it), but that's about it.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

And even HTMLArea is dealing with HTML (as the name suggests). The Word document is converted into HTML by Window's clipboard.

That's what browsers do: they display HTML. That's what Mosaic, the first one, did: it only displayed HTML. Later on you had Javascript coming in.

And that's also the reason why Flash/Shockwave/QuickTime/Acrobate Reader are plug-ins (i.e. external extensions). If you write a GIF-editor plug-in which you offer as a download, you could edit images in the browser. Otherwise: not.
Post Reply