| Author |
Topic Search Topic Options
|
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Topic: Store data on client? Posted: 09 August 2008 at 5:31pm |
I want my asp page to accept & process user inputs, then store that data on the client machine (in txt, or xml). Can this be done under asp - sort of like dropping a cookie - rather than expecting the user to download the file?
I'd want to check for the file when the page is opened, load it if it exists and create new or update on page closing.
Thoughts?
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 09 August 2008 at 5:54pm |
|
Not possible if you could just drop files onto a users PC then this would open up a massive security hole that hackers, viruses, etc. would exploit.
|
|
|
 |
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Posted: 09 August 2008 at 6:37pm |
Figures- have to lock everything up, 'cuz of the clowns and crooks.
Is there a way to get permission and a spot to store file without a lot of client complication?
|
 |
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Posted: 09 August 2008 at 6:56pm |
A cookie may just be the way to go- ie5 has no max size; Netscape has a 4k limit; not sure about Firefox (check me on these). I can stuff the 1k I need into a csv string and persist it as long as I like. This gives me behind-the-scenes operation, no login to forget, db to protect, etc, etc.
Ok- poke my bubble; why is this a bad idea?
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 August 2008 at 8:36am |
Can't see anything wrong with the idea. Of course, not everyone has cookies enabled. If it's just for the user session, you could use an ASP session variable.
There are also other formats that you could use (JSON, XML, etc) if that's more appropriate than CSV. I've started using the prototype framework within the client side code ( http://www.prototypejs.org). It's good as it helps remove the cross browser code issues.
Hope this helps,
Jono
|
 |
Dan H
Newbie
Joined: 17 September 2006
Location: United States
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 August 2008 at 3:44pm |
Thanks for the reply.
That Prototypejs looks interesting! Of course, I'd already promised myself I'd look at Google Android...
There's so much stuff- and so little time!
|
 |
Jono
Mod Builder Group
Joined: 18 September 2006
Location: United Kingdom
Status: Offline
Points: 100
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 August 2008 at 4:00pm |
Yeah - there are *LOTS* of frameworks out there - i went for the simplest, as i'd already written 50% of the application and just wanted the AJAX features to replace my existing library. I then looked at the other features and "enhanced" (i.e. deleted half) my code. It's rare I go "wow", but I did with prototype.
I've not looked at Andriod, but other frameworks give you almost complete applications (and even desktops!)
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 11 August 2008 at 7:45am |
|
One thing to note is that cookies do a round robin trip to the persons computer and back for every HTTP connection on your website, this includes every web page and every image within a web page.
For this reason I would avoid storing larger amounts of data in a cookie as it would slow down your site and increase the amount of bandwidth you use.
|
|
|
 |