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
KaziKazi 

How to upload a file in custom defined folder

Hi all,

 

I am new to visualforce development platfrom.

 

How can I upload a file in a custom defined folder?

 

Plz help me..............

 

 

mohimohi

U may try this one

using standard controller as Document

code snippet for controller:

Document d = (Document) controller.getRecord();
                     Folder folder = [Select Id  From Folder Where Name= :'CandidateImages'];
                    
                     d.folderid=folder.id;
                      System.debug('>>>'+ d.folderid);
                        System.debug('>>>'+ d);
                     insert d;

Folder will return id of folder.