Database file encrypted?

Hello All,

I just want to say thanks in advance. My problem is as follows:

I have a data.db file that I’m exporting to a Dropbox public folder. I’m trying to then re-import that database file and write more to it. My problem is that its encrypted now. I’m not sure if anyone has any experience but is there a way I can prevent it from being encrypted? Obviously once it’s encrypted I cant re-open it in my app. If it’s Dropbox that is encrypting it is there another service I can use that would create a public URL for the app to access the file from and not encrypt it? Any help on this would be amazing.

Thank you!

-B

  1. How do you know it is encrypted.  What is the proof?

  2. Where are you putting the DB?  If your app is on a mobile device, you can only write to it if it is NOT in the resource directory.  i.e. Must be in documents, temporary, …

Thanks for the response. I know its encrypted for two reasons. The first is that corona gives me an error saying the file is either encrypted or is not a database. The second is because when I attempt to open the database from the project sandbox after downloading it from Dropbox it gives me a popup with SQLCipher Encryption (please enter the key used to encrypt the database) which btw, I have no idea what that may be. Also I am putting the DB in the temporary directory I have also tried the documents directory but still have the encryption problem.

-B

Hi,

Is this a database created in Corona?

You could try to .zip the file first and then upload. Of course unzipping once you bring it back down.

https://docs.coronalabs.com/plugin/zip/

-dev

Yes, this is a corona created database. I’ll look into the .zip method.

So I figured it out. Thanks!

Just kidding I’ll tell you how. (I hate when people do that). The file wasn’t actually encrypted I realized on Dropbox that it wasnt a direct download link to my file. This was making it so the file wasn’t actually downloading. There was a “ghost” of the file that was in the directory but it wasn’t the actual file. I looked at documentation for Dropbox on how to have a direct download link to a file and boom now everything works great. Not sure why when I tried to open the DB outside of Corona it said it was encrypted but anyways that’s it, it needs to be a direct download link. 

Thanks again!

  1. How do you know it is encrypted.  What is the proof?

  2. Where are you putting the DB?  If your app is on a mobile device, you can only write to it if it is NOT in the resource directory.  i.e. Must be in documents, temporary, …

Thanks for the response. I know its encrypted for two reasons. The first is that corona gives me an error saying the file is either encrypted or is not a database. The second is because when I attempt to open the database from the project sandbox after downloading it from Dropbox it gives me a popup with SQLCipher Encryption (please enter the key used to encrypt the database) which btw, I have no idea what that may be. Also I am putting the DB in the temporary directory I have also tried the documents directory but still have the encryption problem.

-B

Hi,

Is this a database created in Corona?

You could try to .zip the file first and then upload. Of course unzipping once you bring it back down.

https://docs.coronalabs.com/plugin/zip/

-dev

Yes, this is a corona created database. I’ll look into the .zip method.

So I figured it out. Thanks!

Just kidding I’ll tell you how. (I hate when people do that). The file wasn’t actually encrypted I realized on Dropbox that it wasnt a direct download link to my file. This was making it so the file wasn’t actually downloading. There was a “ghost” of the file that was in the directory but it wasn’t the actual file. I looked at documentation for Dropbox on how to have a direct download link to a file and boom now everything works great. Not sure why when I tried to open the DB outside of Corona it said it was encrypted but anyways that’s it, it needs to be a direct download link. 

Thanks again!