Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Sqlite Flex
hi all,
 
I need to upload a textfile(.txt) to sqlite as a BLOB and retrieve that file when i click a link for example attachment1.txt in my flex AIR desktop project.
 
I upload image as BLOB using pngencoder and base64encoder to store to sqlite and retrive back using base64decoder. it's works fine . but need to upload a textfile in local sqlite , how can i do this?, need help urgent
 
advance thanks
Posted 26-Mar-12 0:19am
Edited 26-Mar-12 19:53pm
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

There is a difference between those 2 formats, you should be aware of that.
 
You should use a generalized approach and store all those files as files and not as special types. So you can use a BLOB for all of them, storing them as binary data.
 
Blog entry explaining:
http://mornie.org/blog/2007/01/10/Storing-binary-data-in-SQLite/[^]
  Permalink  
Comments
Ram Sam 2 at 27-Mar-12 0:55am
   
thanks,can u post code to store and retrive only txt file in sqlite database in flex air application.
TorstenH. at 27-Mar-12 11:57am
   
check this: simple example code
 
and please do a little search on Goole, there are a lot of examples around.
 
I can also recommend to buy a book about Flex/AIR development, the topic is covered in almost all of them. A book does have the advantage of revealing it's secrets without knowing keywords...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 515
1 Maciej Los 290
2 Richard MacCutchan 265
3 BillWoodruff 235
4 Suraj Sahoo | Coding Passion 175
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411028.1 | Last Updated 27 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100