Created
March 21, 2014 07:55
-
-
Save INDIAN2020/9681591 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function uploadImage($file, $field){ | |
if (Input::hasFile($field)) { | |
$oldimage = $file->$field; // Fetch old image | |
File::delete(public_path()'/uploads/' . $oldimage); // The destination were you store the image. | |
} | |
$destinationPath = public_path().'/uploads/'; // The destination were you store the image. | |
$filename = $file->getClientOriginalName(); // Original file name | |
$upload_success = $file->move($destinationPath, $filename); // Now we move the file to its new home. | |
$storing_path = 'uploads/'.$filename; // store file name into the database. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment