MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Amazon settings not working (Closed) (Mono Support )

Viewed 35483 time(s), 13 post(s) 1/17/2012 9:10:32 AMby cosmogonor
cosmogonor

cosmogonor

1/17/2012 12:27:19 PM
Hi

we did all the settings as given in the document (.PDF)
ex. accessKeyId=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
secretAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

created bucket and given that reference in web.config

but its not working

its still referring local folder(s) only

can you explain any settings if i missed ASAP

following link is not good enough i think

http://www.mono-software.com/Blog/post/Mono/29/Amazon-S3-data-provider-for-MonoX/


Thanks
RRR
This content has not been rated yet. 
1176 Reputation 140 Total posts
khorvat

khorvat

1/17/2012 7:55:54 PM
Hi,

can you please be more precise what control / WebPart / module are you using in conjunction with Amazon S3 ? We need to know so we can check where the issue is ?

And please can you post you issues in your priority support forum so we can track it better and share code.

Regards  
This content has not been rated yet. 
15993 Reputation 2214 Total posts
cosmogonor

cosmogonor

1/18/2012 3:57:41 AM
hi

I'm bit unhappy, response is too delayed :)

uploadmodule,profileupload control etc.


the following are the settings we did in web.config but no luck :)

1. <!-- Temporary upload path, used as an intermediary storage for transferring uploaded files to Amazon S3 and similar services -->
<add key="TmpUploadPath" value="/community_emergemd_org" />

2. <!-- main upload path for file storage. For Amazon S3 it has the format /bucket/folder, eg value="/monox" -->
<add key="MonoXUploadPath" value="/community_emergemd_org" />

3. <FileContent defaultProvider="MonoXFileSystemContentProvider">
<providers>
<add name="MonoXFileSystemContentProvider" type="MonoSoftware.MonoX.FileSystem.MonoXFileSystemContentProvider, MonoX" />
<!-- {0} in urlFormat parameter will be replaced by the bucket name. Can be used if you want to use custom domain names via DNS alias entries. -->
<add name="AmazonS3FileSystemContentProvider" type="MonoSoftware.MonoX.FileSystem.AmazonS3FileSystemContentProvider, MonoX" bucketLocation="us" accessKeyId="XXXXXXXXXXXXXXXXXXXXXXXXXXXX" secretAccessKey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" urlFormat="{0}.s3.amazonaws.com" />
</providers>
</FileContent>


no need of sharing code i think, its problem with either web.config settings or with AmazonS3FileSystemContentProvider

thanks
This content has not been rated yet. 
1176 Reputation 140 Total posts
khorvat

khorvat

1/18/2012 6:39:06 AM
Hi,

Amazon S3 is a complex MonoX file provider so we need a bit more time to check the issue. While UploadModule is based on the MonoX FileSystem content providers "profile upload" (Avatar upload) isn't. Avatar upload will save the optimized image directly into a database under the UserAvatar table. As you are a priority user and as I can remember you have 4.1.xx version of MonoX or similar so best approach will be that we provide you with the source code from the latest version of MonoX and then you can sync the code test it and get back to us, so we can be on the same page while troubleshooting the issues. I'll send you a link to your priority forum so you can open a new topic there.

Thanks
This content has not been rated yet. 
15993 Reputation 2214 Total posts
cosmogonor

cosmogonor

1/18/2012 6:46:38 AM
Hi
thanks for the resp.

so how does uploadmodule communicate with Amazon s3.
I need files to be upload to Amazon
any suggestions


thanks
This content has not been rated yet. 
1176 Reputation 140 Total posts
khorvat

khorvat

1/18/2012 7:01:29 AM
Hi,

UploadModule communicates with file system content provider layer and by default it uses the web.config settings as described below
<FileContent defaultProvider="MonoXFileSystemContentProvider">
      <providers>
        <add name="MonoXFileSystemContentProvider" type="MonoSoftware.MonoX.FileSystem.MonoXFileSystemContentProvider, MonoX" />
        <!-- {0} in urlFormat parameter will be replaced by the bucket name. Can be used if you want to use custom domain names via DNS alias entries. -->
        <add name="AmazonS3FileSystemContentProvider" type="MonoSoftware.MonoX.FileSystem.AmazonS3FileSystemContentProvider, MonoX" bucketLocation="us" accessKeyId="" secretAccessKey="" urlFormat="{0}.s3.amazonaws.com" />
      </providers>
    </FileContent>

If you want to redirect your files to Amazon S3 site wide you need to change the default provider e.g.
<FileContent defaultProvider="AmazonS3FileSystemContentProvider">

Or if you want to set Amazon S3 on the UploadModule only then you can set the FileContentProvider property to an instance of Amazon S3 provider. to get the Amazon S3 content provider please use the code below:
FileContentManager.GetProvider(this.Context, "MonoSoftware.MonoX.FileSystem.AmazonS3FileSystemContentProvider, MonoX")

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
cosmogonor

cosmogonor

1/18/2012 7:13:37 AM
ya ya I did that in web.config

then its giving error that the path locating local folder
i.e its trying to create a folder with bucket name in the application and throwing error
but i didn't check in FileContentManager coz it fetches default provider


i think there is a problem with AmazonS3FileSystemContentProvider class

thanks
This content has not been rated yet. 
1176 Reputation 140 Total posts
khorvat

khorvat

1/18/2012 7:22:48 AM
Hi,

just to test one issue that was reported earlier, please set the UploadModule property called TargetFolder to the following value
this.TargetFolder = "/Upload";
as it is used as temporary upload folder.

Note: Please provide us with the error stack trace.

Thanks
This content has not been rated yet. 
15993 Reputation 2214 Total posts
khorvat

khorvat

1/18/2012 8:30:23 AM
Please note that code parser from our forum has removed the tilde symbol in the "/Upload" string.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
cosmogonor

cosmogonor

1/18/2012 9:52:13 AM
Hi

I'm getting the same issue.............

web.config settings

<!-- Temporary upload path, used as an intermediary storage for transferring uploaded files to Amazon S3 and similar services -->
<add key="TmpUploadPath" value="/community_emergemd_org" />

<!-- main upload path for file storage. For Amazon S3 it has the format /bucket/folder, eg value="/monox" -->
<add key="MonoXUploadPath" value="/community_emergemd_org" />

<FileContent defaultProvider="AmazonS3FileSystemContentProvider">
<providers>
<add name="MonoXFileSystemContentProvider" type="MonoSoftware.MonoX.FileSystem.MonoXFileSystemContentProvider, MonoX" />
<!-- {0} in urlFormat parameter will be replaced by the bucket name. Can be used if you want to use custom domain names via DNS alias entries. -->
<add name="AmazonS3FileSystemContentProvider" type="MonoSoftware.MonoX.FileSystem.AmazonS3FileSystemContentProvider, MonoX" bucketLocation="us" accessKeyId="XXXXXXXXXXXXXXXXXXXXXX" secretAccessKey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" urlFormat="{0}.s3.amazonaws.com" />
</providers>
</FileContent>




error text

Please look at the bold text ,its always trying to create a folder locally with bucket name


Server Error in '/' Application.Could not find a part of the path 'F:\Community\MonoX\Portal\community_emergemd_org\user\emdadmin\note\M6kjC1luLk2wwp_cADKPJQ\Tulips.jpg'.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'F:\Community\MonoX\Portal\community_emergemd_org\user\emdadmin\note\M6kjC1luLk2wwp_cADKPJQ\Tulips.jpg'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[DirectoryNotFoundException: Could not find a part of the path 'F:\Community\MonoX\Portal\community_emergemd_org\user\emdadmin\note\M6kjC1luLk2wwp_cADKPJQ\Tulips.jpg'.]
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +359
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1295
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +60
System.IO.FileStream..ctor(String path, FileMode mode) +55
System.Web.HttpPostedFile.SaveAs(String filename) +254
Telerik.Web.UI.PostedFile.SaveAs(String fileName, Boolean overwrite) +75
Telerik.Web.UI.RadUpload.ProcessValidFiles() +312
Telerik.Web.UI.RadUpload.OnLoad(EventArgs e) +49
System.Web.UI.Control.LoadRecursive() +128
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Control.LoadRecursive() +226
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3530


Thanks
This content has not been rated yet. 
1176 Reputation 140 Total posts
1 2