EldoS | Feel safer!

Software components for data protection, secure storage and transfer

System.ArgumentOutOfRangeException when try to save jpg

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#26894
Posted: 10/18/2013 07:07:11
by Andreas Pross (Standard support level)
Joined: 10/17/2013
Posts: 8

I am currently evaluating CFS 5.

I have modiefied the example "Mapper" to store data on a SQL Database.
I have managed to create folders, delete, rename, create text files, but I am stuck with one thing:

I cant't store files like JPG. I can copy and paste txt files without problem but not jpg. I have traced my code and have seen, that there is a difference when pasting txt or jpg.

pasting txt creates my file, sets the file size and writes data to it.

pasting a jpg creates the file, setAllocationSize, resizes the file and starts reading it (Memorystream is empty at that point). During the read... there is a ArgumentOutOfRangeException somewhere and I have an empty file cause Write is never called.

Any ideas if i have missed something important?

My trace shows that the exception seems to occure outside the callback cause my callback is alreade "Completed" before the exception is raised.

Here is my Trace:
13:50:53:2790 - CbFsCreateFile: \Camillo-Seite.jpg
13:50:53:3680 - CbFsCreateFile - Completed
13:50:53:3680 - CbFsSetAllocationSize
13:50:53:3690 - CbFsSetAllocationSize - Completed
13:50:53:3690 - CbFsGetFileInfo: \Camillo-Seite.jpg
13:50:53:3730 - CbFsGetFileInfo - Completed
13:50:53:3740 - CbFsSetEndOfFile: \Camillo-Seite.jpg EOF: 280641
13:50:53:3740 - CbFsSetEndOfFile - Completed: \Camillo-Seite.jpg
13:50:53:3770 - CbFsSetFileAttributes
13:50:53:3770 - CbFsGetFileInfo: \Camillo-Seite.jpg
13:50:53:3810 - CbFsGetFileInfo - Completed
13:50:53:3820 - CbFsFsRead: \Camillo-Seite.jpg
13:50:53:3820 - CbFsFsRead. Position 0
13:50:53:3830 - CbFsFsRead. BytesToRead 32768
13:50:53:3830 - CbFsFsRead. DataStream 280641
13:50:53:3840 - CbFsFsRead. PositionAfterRead 32768
13:50:53:3840 - CbFsFsRead. BytesRead 32768
13:50:53:3840 - CbFsFsRead - Completed: \Camillo-Seite.jpg
Eine Ausnahme (erste Chance) des Typs "System.ArgumentOutOfRangeException" ist in mscorlib.dll aufgetreten.
13:50:53:3890 - CbFsFsRead: \Camillo-Seite.jpg
13:50:53:3890 - CbFsFsRead. Position 249856
13:50:53:3900 - CbFsFsRead. BytesToRead 30785
13:50:53:3900 - CbFsFsRead. DataStream 280641
13:50:53:3910 - CbFsFsRead. PositionAfterRead 280641
13:50:53:3910 - CbFsFsRead. BytesRead 30785
13:50:53:3920 - CbFsFsRead - Completed: \Camillo-Seite.jpg
13:50:53:3930 - CbFsFsRead: \Camillo-Seite.jpg
13:50:53:3930 - CbFsFsRead. Position 32768
13:50:53:3930 - CbFsFsRead. BytesToRead 32768
13:50:53:3941 - CbFsFsRead. DataStream 280641
13:50:53:3941 - CbFsFsRead. PositionAfterRead 65536
13:50:53:3951 - CbFsFsRead. BytesRead 32768
13:50:53:3951 - CbFsFsRead - Completed: \Camillo-Seite.jpg
13:50:53:3960 - CbFsFsRead: \Camillo-Seite.jpg
13:50:53:3960 - CbFsFsRead. Position 122880
13:50:53:3971 - CbFsFsRead. BytesToRead 32768
13:50:53:3971 - CbFsFsRead. DataStream 280641
13:50:53:3971 - CbFsFsRead. PositionAfterRead 155648
13:50:53:3981 - CbFsFsRead. BytesRead 32768
13:50:53:3981 - CbFsFsRead - Completed: \Camillo-Seite.jpg
13:50:53:4041 - CbFsFsRead: \Camillo-Seite.jpg
13:50:53:4041 - CbFsFsRead. Position 65536
13:50:53:4051 - CbFsFsRead. BytesToRead 32768
13:50:53:4051 - CbFsFsRead. DataStream 280641
13:50:53:4051 - CbFsFsRead. PositionAfterRead 98304
13:50:53:4061 - CbFsFsRead. BytesRead 32768
13:50:53:4061 - CbFsFsRead - Completed: \Camillo-Seite.jpg
Eine Ausnahme (erste Chance) des Typs "System.ArgumentOutOfRangeException" ist in mscorlib.dll aufgetreten.
13:50:53:5141 - CbFsCloseFile: \Camillo-Seite.jpg
13:50:53:5151 - CbFsCloseFile - All filehandels are Closed: \Camillo-Seite.jpg
13:50:53:5151 - File has Changed
13:50:53:5201 - Submitting to Database
13:50:53:7832 - CbFsCloseFile - Completed: \Camillo-Seite.jpg
#26895
Posted: 10/18/2013 07:15:31
by Volodymyr Zinin (Team)

Moved to HelpDesk for further investigation.

Reply

Statistics

Topic viewed 793 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!