function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
yogesh goadyogesh goad 

Problem in displaying pdf Attachment file on a visual force page

I am able to upload and retrieve the list of attachments to my custom object in a table.
clicking on the attachment id in the table takes me to the page in the below image.

 User-added image

 The problem is with the "Viewfile" link on this page. it downloads the uploaded file without extension instead of displaying it in  browser.
Is there a problem with my browser or its a problem with salesforce.

This same link works fine with Documents but size constraint does'nt allow to upload files larger than 5 mb with Document object.

The "viewfile" link with which i have problems was working previously for other users . i was suggested to use the above link to display pdf attachment on the browser by previos users. here is something which i came through searching for a solution to my problem and the pictures show it worked fine for him.http://salesforce.stackexchange.com/questions/28268/rendering-attachment-on-visualforce-page
bob_buzzardbob_buzzard
I reckon the problem here is the filename - you have called the attachment asp.net, which will cause the browser to look for a plugin that can display .net files. If you name the file as a .pdf, or skip the suffix completely, I'd expect it to work.
yogesh goadyogesh goad
thanks bob. but i have another file named "forcebook" in my attachments and a image named "image001".
look into the image below
User-added image

when i click on forcebook link it takes me here.
User-added image

and when i click view file in firefox. this is what i get instead of displaying that file in browser
User-added image

now i dont think there is a problem with file name.

and i can show you all the code in case you need it.
bob_buzzardbob_buzzard
That looks like firefox doesn't know how to open the file in question. I doubt the code will help as its the browser receiving the data.
yogesh goadyogesh goad
the chrome directly downloads it without asking for any options as firefox asks.
And this "viewfile" link doesnt work even on other systems that i have tried so far.
I spoke to some people and they said the "viewfile" link worked fine for them.