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.

We are uploading large video files are of 25mb to Amazon,But showing blank page in IE   (Mono Support )

Viewed 14896 time(s), 4 post(s) 10/21/2013 1:52:00 PMby cosmogonor
cosmogonor

cosmogonor

10/21/2013 1:52:17 PM

We are trying to upload large video files more than 25MB to Amazon S3 using UploadModule(radUpload).
But its taking very long time and getting page cannot display error 
before getting the response back from amazon Server.
the following line causing this error in AmazonS3FileSystemContentProvider class
ObjectAddResponse objectAddResponse = this.service.ObjectAdd(objectAddRequest)

All our settings are correct in-terms of accessKeyId and secretAccessKey
<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="xxxxxxxxxxxxx" secretAccessKey="xxxxxxxxxxxxxxxxxxxxxxx" 
urlFormat="{0}.s3.amazonaws.com" />
      </providers>
    </FileContent>

here is the code:
public string StoreFile(Stream stream, string path)
        {
            try
            {
                //cannot save to the root of hierarchy, has to choose a bucket first
                if (IsBucket(path))
                    return string.Empty;

                using (ObjectAddRequest objectAddRequest = 
new ObjectAddRequest(GetBucketNameFromPath(path), GetEncodedPath(path)))
                {
                    objectAddRequest.LoadStreamWithBytes(stream.ReadToEnd());
                    using (ObjectAddResponse objectAddResponse = this.service.ObjectAdd(objectAddRequest))
                    { }
                }
                SetPublicACL(path);
            }
            catch
            {
            }

Finally we even tried with RadAsyncUpload but the same issue occurs.

Please let us know your concerns ASAP

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

pajo

10/21/2013 3:14:35 PM
Hi,

1. can you tell us if you can upload small files without problem?
2. can you give us stack trace of the error you're getting?

anyway uploading large files with monoX upload modules will always be a problem, I would suggest to use different strategy when dealing with large files http://aws.amazon.com/articles/1434
This content has not been rated yet. 
629 Reputation 83 Total posts
cosmogonor

cosmogonor

10/21/2013 3:32:46 PM
yes we can upload smaller files.
We are able to upload video files that are Max of 3.0MB
we are not getting any response from server to check stack trace.


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

pajo

10/22/2013 8:17:30 AM
Hi,

you need to monitor network traffic to see what is happening, if you're not getting any exceptions. Uploading of a  large files can be slow on asymmetric lines where upload speed is much lower than download speed. In asp .net when you upload a file to the page, page life cycle will start when file is uploaded completely and stored in memory. Then you need to upload file from memory to the amazon s3 service.  As you can see you're uploading file twice and depending on your network speed this can be very slow. Also you're adding additional load on server network throughput and any concurrent uploads will slow your server even more.

Best solution is to avoid sending file to your server and upload it directly to the s3 account, as it's explained in this article http://aws.amazon.com/articles/1434. You would need to setup form for upload, and also create a page where you would handle successful upload and store file info to the db so you can use other modules like file gallery. You would use FileRepository to handle this, you can open another thread if you'll have troubles with saving file info in the db.

You can also create a proxy handler that would open upload connection on the s3 account and stream uploaded content directly when you receive it. It will make handling connections with s3 server easier but it's very similar to the first approach and it will still burden your server and I would not recommend it unless you need to fully control upload process.
This content has not been rated yet. 
629 Reputation 83 Total posts