step-up-labs / firebase-storage-dotnet

C# library for Firebase Storage
MIT License
140 stars 35 forks source link

Problem after uploading pdf. #27

Closed alexander9727 closed 4 years ago

alexander9727 commented 5 years ago

When I upload a pdf file my app crashes but the file has uploaded properly and I can see it in my firebase console.

This is the code: public static async Task UploadPDF(Stream file, string PersonID, string fileName) { try { var storage = await firebaseStorage.Child(PersonID).Child(fileName + ".pdf").PutAsync(file); return storage; }catch(Exception e) { Message.ShowToast(e.ToString()); return null; } }

And this is the error: FATAL UNHANDLED EXCEPTION: System.NotSupportedException: Specified method is not supported. at Android.Runtime.InputStreamInvoker.get_Position () [0x00000] in <87aaae1e4e224b88a1398ac27fed7129>:0 at Firebase.Storage.FirebaseStorageTask+d14.MoveNext () [0x00075] in <05490158a17440cdbb77cdfa1390ba02>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b6_1 (System.Object state) [0x00000] in :0 at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in :0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in :0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in :0 at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in :0 at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in :0 at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in :0

Any help or suggestion is appreciated. Thank you

bezysoftware commented 4 years ago

What runtime are you using the lib in? Xamarin?

alexander9727 commented 4 years ago

Yes that is correct.

On Fri, 4 Oct 2019, 6:07 pm Tomas Bezouska, notifications@github.com wrote:

What runtime are you using the lib in? Xamarin?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/step-up-labs/firebase-storage-dotnet/issues/27?email_source=notifications&email_token=ALMBXMURH6IZANLIHH22VKLQM42IZA5CNFSM4HHXXQO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEALQFTY#issuecomment-538378959, or mute the thread https://github.com/notifications/unsubscribe-auth/ALMBXMTQDIVHAXVXKOC6ZDDQM42IZANCNFSM4HHXXQOQ .

bezysoftware commented 4 years ago

Ok I recently started learning xamarin, I'll try to create a sample app and see what's going on

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing the issue due to inactivity. Feel free to re-open