You need to sign in to do that
Don't have an account?
How to upload Image using Input File tag in Visual Force.
Hello Every one ,
I am trying to upload Image using the Visual Force input tag, The problem I am facing is when I click on the document "Click to view the file " Link it show a 0 byte file .
Visual Force Code:-
<apex:pageBlockSection title="Upload Logo " columns="1" collapsible="true">
<apex:inputFile value="{!document.body}" filename="{!document.name}" filesize="10"/>
</apex:pageBlockSection>
Controller Code:-
document = new Document();
document.folderid = UserInfo.getUserId(); //store in Personal Documents
document.Name = 'Company Logo';
document.Type ='gif';
insert document;
Please let me know what I am doing wrong.
Thanks and Regards
Vivek Manchanda
I wrote a sample code that uploads a file. Check out the page and the controller class in the zip file at the following location:
File Upload Sample Code
Let me know if you need any further help.