Highlighted
ratish777
6 Indium

Shareable URL not opening in Chrome

Jump to solution

Hi,

When I try to open a file from Atmos using Shareable URL in Google Chrome, it is not opening. However it opens well with IE 8 and Mozilla.

Please help.

Thanks and regards,

Ratish.

0 Kudos
1 Solution

Accepted Solutions
8 Krypton

Re: Shareable URL not opening in Chrome

Jump to solution

It looks like UploadHelper in C# doesn't allow for setting the mimetype.  You can skip UploadHelper and do it like this:

EsuRestApi cloudRest = new EsuRestApi("cloudonestorage.peer1.com", 443, uid, sharedSecret);

Acl acl = new Acl();

acl.AddGrant(new Grant(new Grantee(cloudRest.GetUid(), Grantee.GRANTEE_TYPE.USER), Permission.FULL_CONTROL));

         

long totalBytes = new FileInfo(fromfile).Length;

Stream s = File.OpenRead(fromfile);

cloudRest.CreateObjectFromStreamOnPath(new ObjectPath(tofile), acl, null, s, totalBytes, "application/pdf", null);

s.Close();

Also note that the ACL you're creating is the default; you could just use 'null' in the ACL argument if that's the ACL you want.

I'll also open a ticket to allow setting the mimetype in the C# UploadHelper.

0 Kudos
10 Replies
8 Krypton

Re: Shareable URL not opening in Chrome

Jump to solution

Are you saying that it doesn't download when using Chrome or that it doesn't automatically prompt the user to open the downloaded object? 

0 Kudos
ratish777
6 Indium

Re: Shareable URL not opening in Chrome

Jump to solution

It neither downloads nor promts the user to download.

0 Kudos
8 Krypton

Re: Shareable URL not opening in Chrome

Jump to solution

Can you post an example?  I'm not able to recreate this.

0 Kudos
ratish777
6 Indium

Re: Shareable URL not opening in Chrome

Jump to solution

I have generated the below sharable URL from AtmosFox Organizer :

https://cloudonestorage.peer1.com/rest/namespace/Company1/18399/18399_54_4454__4b0ab729a2230dac04ce3...

If you try to open the above url in Google chrome it won't open, however it will open in IE and Mozilla.

0 Kudos
8 Krypton

Re: Shareable URL not opening in Chrome

Jump to solution

I see the same issue.  I suspect it's actually a bug in Chrome since the download doesn't even seem to start.  However, I did notice that there wasn't a mimetype specified for the object in Atmos (it was defaulted to "application/octet-stream").  I would recommend setting the mime type to "application/pdf" when you create or update the object in Atmos.  This mimetype will then be returned when you request it via shareable URL.

0 Kudos
DarrenSoothill
6 Indium

Re: Shareable URL not opening in Chrome

Jump to solution

So I have tried Safari and Firefox on the Mac and they both work fine but Chrome doesn't which to me says there is an issue with Chrome.

Darren

From: ratish777 <emc-community-network@emc.com<mailto:emc-community-network@emc.com>>

Reply-To: "jive-116553561-oqk-2-cf9o@emc-developer.hosted.jivesoftware.com<mailto:jive-116553561-oqk-2-cf9o@emc-developer.hosted.jivesoftware.com>" <jive-116553561-oqk-2-cf9o@emc-developer.hosted.jivesoftware.com<mailto:jive-116553561-oqk-2-cf9o@emc-developer.hosted.jivesoftware.com>>

Date: Tue, 6 Dec 2011 10:34:47 -0500

To: Darren Soothill <darren.soothill@emc.com<mailto:darren.soothill@emc.com>>

Subject: New message: "Shareable URL not opening in Chrome"

EMC Community Network<https://community.emc.com/index.jspa>

Re: Shareable URL not opening in Chrome

created by ratish777<https://community.emc.com/people/ratish777> in Atmos - View the full discussion<https://community.emc.com/message/579660#579660

0 Kudos
8 Krypton

Re: Shareable URL not opening in Chrome

Jump to solution

Chrome's internal PDF renderer doesn't like the file (maybe due to the lack of a mime type).  You can disable that plug-in though and verify that the file downloads (and then use Acrobat to view it).  In Chrome, navigate to "chrome://plugins" and click on "disable" below the Chrome PDF Viewer.  Then try the link again.

ratish777
6 Indium

Re: Shareable URL not opening in Chrome

Jump to solution

Thanks Jason,

Can you please tell me how to add mime type while uploading a document. I use the following code to upload:

EsuRestApi cloudRest = new EsuRestApi("cloudonestorage.peer1.com", 443, uid, sharedSecret);

            Acl acl = new Acl();

            acl.AddGrant(new Grant(new Grantee(cloudRest.GetUid(), Grantee.GRANTEE_TYPE.USER), Permission.FULL_CONTROL));

          

            EsuApi cloud = cloudRest;

            UploadHelper upload = new UploadHelper(cloud);

            ObjectId oId = upload.CreateObjectOnPath(new ObjectPath(tofile), fromfile, acl, null);

Please help.

Regards,

Ratish

0 Kudos
8 Krypton

Re: Shareable URL not opening in Chrome

Jump to solution

It looks like UploadHelper in C# doesn't allow for setting the mimetype.  You can skip UploadHelper and do it like this:

EsuRestApi cloudRest = new EsuRestApi("cloudonestorage.peer1.com", 443, uid, sharedSecret);

Acl acl = new Acl();

acl.AddGrant(new Grant(new Grantee(cloudRest.GetUid(), Grantee.GRANTEE_TYPE.USER), Permission.FULL_CONTROL));

         

long totalBytes = new FileInfo(fromfile).Length;

Stream s = File.OpenRead(fromfile);

cloudRest.CreateObjectFromStreamOnPath(new ObjectPath(tofile), acl, null, s, totalBytes, "application/pdf", null);

s.Close();

Also note that the ACL you're creating is the default; you could just use 'null' in the ACL argument if that's the ACL you want.

I'll also open a ticket to allow setting the mimetype in the C# UploadHelper.

0 Kudos