unauthorizedAccessException-more details

0 votes

after creating user 'daniel' password 'daniel' in your cloud and after authentication is passes, call this:

uploadService.UploadFile(

  strtFileUpload.sFileName,   

  strtFileUpload.sPath,

  UploadFileType.TXT, 

  strtFileUpload.sDesc,

  new AppCallBack_fileUpload());

}///end of if(bRequestToUploadFile)

where  

strtFileUpload.sFileName is: "/view1.txt"

strtFileUpload.sPath is: sAppPersistentDataPath = Application.persistentDataPath;
and for mac as host is: /Users/daniel/Library/Caches/Approducer/u3appFramework13/
 
during test run got exception:

/// UnauthorizedAccessException: Access to the path '/Users/daniel/Library/Caches/APProducer/u3appFramework13' is denied.

/// System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options)

/// System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)

/// (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)

/// System.IO.File.OpenRead (System.String path)

/// System.IO.File.ReadAllBytes (System.String path)

/// com.shephertz.app42.paas.sdk.csharp.connection.RESTConnectorWWW.ExecuteMultipart (System.String name, System.String filePath, System.Collections.Generic.Dictionary`2 queryParams, System.Collections.Generic.Dictionary`2 postParams, System.Collections.Generic.Dictionary`2 headerParams, System.String url, System.String accept, App42CallBack callBack)

/// com.shephertz.app42.paas.sdk.csharp.upload.UploadService.UploadFile (System.String name, System.String filePath, System.String fileType, System.String description, App42CallBack callBack)

/// appA42serviceManager.Update () (at Assets/script/appMono/appA42serviceManager.cs:412)

 

the host username is 'daniel' and password is 'daniel'. thus should not have access being denied.

 

i did also test upload a file from device running android and wp8 but nothing effective to the cloud.

 
daniel 

 

related to an answer for: unauthorizedAccessException
asked May 23, 2014 in App42 Cloud API-BaaS by mrdaniel (10 points)
edited May 23, 2014 by mrdaniel

1 Answer

0 votes

This is not User Authentication error. You don't need to authenticate user before uploading a file (if you are not using ACL enabled app, For more details about ACL check http://api.shephertz.com/tutorial/Securing-Your-App/ ).

So This UnAuthorized Access error is about to file you are trying to access for upload, as in your error the first two line says :-

/// UnauthorizedAccessException: Access to the path '/Users/daniel/Library/Caches/APProducer/u3appFramework13' is denied.

So, for this you have to make a folder in your Assets and Named it "StreamingAssets" . For more Information About How to access a file in iOS and other plateforms read this Unity Manual about Streaming Assets :-

http://docs.unity3d.com/Documentation/Manual/StreamingAssets.html

answered May 23, 2014 by Akshay.Mishra (179 points)
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...