[Owncloud] How to read a file when encryption is on? Was: What has happened with OC_FilesystemView?

Robin Appelman icewind at owncloud.com
Thu Apr 26 10:34:23 UTC 2012


On Thursday 26 April 2012 11:58:14 Thomas Tanghus wrote:
> On Thursday 26 April 2012 03:45 Thomas Tanghus wrote:
> > I couldn't figure out why my contact import stopped working, until I
> > looked
> > at the tmp files that were all binary garble.
> > 
> > This:
> >  $view = OC_App::getStorage('contacts');
> >  $view->file_put_contents('/somefile.txt','some text');
> > 
> > produces:
> >  +�Α½’-ΰΑ%„ίο8Sν
> 
> D'oh... It was a bit late, so I didn't stop to think that it looked like the
> file was encrypted - and yes, I had turned encryption on just to test.
> 
> This works OK:
> 
>  $view = new OC_FilesystemView('/'.OC_User::getUser());
>  if($view->file_put_contents('/somefile.txt','some text')) {
>     echo $view->file_get_contents('/somefile.txt');
>  }
> 
> But if I write the file in one request, and read it in another it doesn't
> get decrypted.

Strange, will look into it later

 - Robin Appelman



More information about the Owncloud mailing list