+ Start a Discussion

is there any file format that takes every thing(like image,text files..) and display as it is.

means for example (.jpg)  extention takes images,(.txt) extention takes text files ,but i want an extention that takes both(image,text files).
Hi srilakshmi,

Could you please elaborate on the use case..where do you wish to use this extension ?
This will help us understand the requirement better and suggest accordingly..
apex page:

<apex:page Controller="InputFileAttachment">
  <apex:sectionHeader title="Attach File "/>
  <apex:form >
  <apex:pageBlock >
      <apex:pageBlockButtons >
          <apex:commandButton value="Attach New File" action="{!AttachNewFile}"/>

      <apex:pageBlockSection >    
          <apex:inputFile value="{!Attach}"></apex:inputFile>        

apex class:

public class InputFileAttachment {
    public blob Attach {get;set;} 
    string CurrentId ;
    public InputFileAttachment ()
        CurrentId = ApexPages.CurrentPage().getParameters().get('Id');     
    public pagereference AttachNewFile()
        delete [select id from Attachment where ParentId=:CurrentId];
        Blob b = Attach;
        Attachment At = new Attachment(Name ='NewFile'+'.jpg',body = b,parentId=CurrentId);
        insert At;      
        }Catch(Exception ee){}
        return null;

i found a program to attach something(textfiles,images) to a record in sales force.here in this "Attachment At = new Attachment(Name ='NewFile'+'.jpg',body = b,parentId=CurrentId);"  statement ".jpg" is the extention so when ever i run this program images are attching  and displayed properly,but not text files. if i change extention to .txt it works for text files but not for images.so insted of .jpg,.txt  i want another  extention that takes both image,text file what ever it is i want to attach.(.html is not working)