chinhdo / txFileManager

.NET Transactional File Manager is a .NET Standard library that allows you to enlist file operations (file/folder copies, writes, deletes, appends, etc.) in distributed transactions.
MIT License
111 stars 13 forks source link

Multiple File Upload Issue #45

Open arc1997 opened 7 months ago

arc1997 commented 7 months ago

Using txFileManager to upload multiple file upload at once. The File Upload gets stuck when tried to upload multiple files. In incognito mode it works fine but in normal chrome browser it doesn't work fine. After clearing the cache it works fine. I am using version 1.3 is this issue resolved in latest version. How to resolve this cache issue with file upload?

chinhdo commented 7 months ago

Hello @arc1997,

This package is a class library and does not directly support uploading files via a browser. I am guessing you are using this package on your website? Do you have an error or stack trace? Can you explain more what you meant by "upload"? Please include the steps to reproduce the issue.

By the way, the latest version if 1.5.0.1 on Nuget.

Thanks

arc1997 commented 7 months ago

Basically using txFileManager to createdirectory. Have a web application which using kendo upload to upload files on client ui. After creating directory saving those files at temporary directory uploaded from client. On UI user can select multiple files at once & they are saved to temporary folder. To be precise it fails while instantiating "TxFileManager" object with an error "cannot access .... path". And it is being initialized for each file upload while doing a multi upload. But after clearing cache it works fine & saves all files but have to clear cache everytime.

chinhdo commented 7 months ago

Can you try using the latest version 1.5.0.1 and if you still get the error, share the exact exception message and full exception stack trace with me? Thanks

arc1997 commented 7 months ago

yes sure thanks does latest version 1.5.0.1 works with .net framework 4.5?

arc1997 commented 7 months ago

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/ROOT/FTMS

Process ID: 6132

Exception: System.Transactions.TransactionException

Message: Failed to roll back.

StackTrace: at ChinhDo.Transactions.TxEnlistment.Rollback(Enlistment enlistment) at System.Transactions.VolatileEnlistmentAborting.EnterState(InternalEnlistment enlistment) at System.Transactions.TransactionStateAborted.EnterState(InternalTransaction tx) at System.Transactions.EnlistableStates.Timeout(InternalTransaction tx) at System.Transactions.Bucket.TimeoutTransactions() at System.Transactions.BucketSet.TimeoutTransactions() at System.Transactions.TransactionTable.ThreadTimer(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.TimerQueueTimer.CallCallback() at System.Threading.TimerQueueTimer.Fire() at System.Threading.TimerQueue.FireNextTimers()

InnerException: System.UnauthorizedAccessException

Message: Access to the path 'C:\Windows\TEMP\CdFileMgr\f6d5e726-8655-48.BIN' is denied.

StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost) at ChinhDo.Transactions.TxEnlistment.Rollback(Enlistment enlistment)

chinhdo commented 7 months ago

Yes this library is a .NET Standard 2.0 library and will work with most .NET Framework 4.5/4.6/4.7/4.8 as well as .NET Core/.NET 6/7/8.

Can you give the latest version a try?