Write the code as shown in snapshot, We are checking if the file exits in the folder then we are setting the value of FileExistsFlg variable to 1 else it will remain 0.
As now we have set the value of variable FileExistsFlg, we can use this variable to run our next tasks if file exists (FileExistsFlg=1). Bring Data Flow task in Control Flow Pane and Connect Script Task to it. Double click on Green line ( Precedence Constraint) between two tasks.
Choose Expression and Constraint from Evaluation operation drop down and in Value choose "Success". In expression write @FileExistsFlg==1.
This mean whenever the file will be available in given folder , our package will execute and it will run Data Flow task. If file will not available it will stop after executing Script task. As to run Data file the variable ( FileExistsFlg should be 1.
As in snapshot we can see that when the file will be present, the data flow task will run otherwise it will stop at Script task.