Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

3671

December 6th, 2011 06:00

Shareable URL not opening in Chrome

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.

281 Posts

December 6th, 2011 08:00

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.

281 Posts

December 6th, 2011 07:00

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.

16 Posts

December 6th, 2011 07:00

It neither downloads nor promts the user to download.

222 Posts

December 6th, 2011 07:00

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? 

222 Posts

December 6th, 2011 07:00

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

16 Posts

December 6th, 2011 07:00

I have generated the below sharable URL from AtmosFox Organizer :

https://cloudonestorage.peer1.com/rest/namespace/Company1/18399/18399_54_4454__4b0ab729a2230dac04ce3ff6f6783004eccfe896c3f9.pdf?uid=2cb3b7d371d647c4a469db60a13e3add%2F6131312&expires=1323192695&signature=SPh6Q1G9CWacFDscRo5iAyuX%2FkQ%3D

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

December 6th, 2011 07:00

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 >

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

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

To: Darren Soothill >

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

EMC Community Network

Re: Shareable URL not opening in Chrome

created by ratish777 in Atmos - View the full discussion

110 Posts

December 6th, 2011 07:00

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.

16 Posts

December 6th, 2011 08:00

Thanks Jason,

The above code worked, now I am able to open the documents in Chrome as well.

Regards,

Ratish

16 Posts

December 6th, 2011 08:00

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

No Events found!

Top