You need to sign in to do that
Don't have an account?

Upload and view
HI,
my requirement is to upload a file and once the file is uploaded,
i must be able to view the content of the uploaded file.could
anyone help me with an example or a sample code how could i
achieve this...
Thank you.
hi
Use This code in Visualforce page:
<apex:inputFile value="{!contentFile}" filename="{!FileName}" />
Use this code on submit in Apex Class:
Public Blob contentFile{get;set;}
Public Void Submit()
{
String FinalResult=contentFile.toString();
}
If u dont want to convert it into String then Store file into Doucument Object record
If any query then ask
public Blob contentFile{get;set;}Public Void Submit(){String FinalResult=contentFile.toString();}
HI,
could u pls let me know the sample code
As i am new to visualForce,so could u
send me the code so i could achieve my task..
Thank you in advance....
Hi,
when i upload a specefic file
i should he able to get the uploaded
content from the controller.
could anybody help me witht he sample
Yhank You..
Here is a small example, let me know if that helps you.
Below is the code for the VF Page :
and this is the controller for the VF page :
Let me know if you have any queries!
I think I have already posted you the solution.
This will give you the uploaded fies list.
In Class :
In Page :
This will show you the document list alongwith the links to the documents.
Hope this will help!
HI,
this is working perfectly , but u have used document ,
but i dont want that , and the content must be saved
as string , could u give me any other example for this
Thank You