$imageURL = 'https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidv97qmJwUu4M0TAG5vrIuRLFN1YpSwJnDp6huR_eRyN3OeV2tKg_7hyK9adAH3ex6bAys6LZur073vkHRl3833KjuuoVwlaq3b1XfvqGUBKJo3TZZh54KkqgtAVGv9yQdSLkkCK47L-G2/s1600/Upload+image+from+URL+to+S3+in+Zend+Framework.png'; $extension = 'png'; $myAwsKey = 'AKIAP3APTHAC2DQLGJA'; //S3 AWS Key $myAwsSecretKey = 'YJiKlVFERFuF/sadfzgS2jgj6z/Qhjkhsh'; //S3 Secret Key $s3Media = 's3mediafolder'; //S3 Folder path $s3 = new Zend_Service_Amazon_S3($myAwsKey, $myAwsSecretKey); $uploadTo = 'clientProfileImages/thumb/205_test_push.png'; try { $s3->putFile($imageURL, "$s3Media/$uploadTo", array( Zend_Service_Amazon_S3::S3_ACL_HEADER => Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ, 'x-amz-storage-class' => 'REDUCED_REDUNDANCY', 'ContentType' => $extension )); } catch (Exception $e) { echo $e->getMessage(); die; } echo 'Image Uploaded Successfully in S3';
We are Web Technology Experts Team who provide you Important information on Web Development, Interview Questions and Answers, live project problem and their solution and online free tutorials.
Friday, 27 May 2016
Upload Image from URL to S3 in Zend Framework
Wednesday, 25 May 2016
JavaScript Interview Questions and Answers for Experienced 2016
Question: How to Get class name using jQuery?
className = $('#IdWhichClassNameWantToGet').attr('class');
Question: How to check a div having class name or Not?
className = $('#IdWhichClassNameWantToCheck').hasClass('hasClass');
Question: How to add a focus on inputbox?
className = $('input#inputBoxId').focus();
Question: How to add X number of days in date?
var dateObject = new Date(); dateObject.setDate(dateObject.getDate()+5); //Add 5 Days
Question: How to add X number of minutes in date?
var dateObject = new Date(); dateObject.setDate(dateObject.getTime()+(30 * 60 * 1000)); //Add 30 Minutes
Question: How to delete an element from Associate Array?
var myArray = new Object(); myArray["firstname"] = "Arun"; myArray["lastname"] = "Kumar"; myArray["age"] = "26"; console.log(myArray); /* Object { firstname="Arun", lastname="Kumar", age="26"} */ delete myArray["age"];//Delete an Element console.log(myArray); /* Object { firstname="Arun", lastname="Kumar"} */Question: How to exit from for loop from JS?
Use return true to exit from loop. For Example:
for (i = 0; i < 5; i++) { if(i>2){ break; } }
Question: How to load a noimage.gif, If there we are unable to load images?
Use return true to exit from loop. For Example:
Question: How to change the image source with jQuery?
Use return true to exit from loop. For Example:
$("#imageElement").attr("src","/folder/image.jpg");
Question: How to get image Height & Width?
var img = document.getElementById('imageId'); var width = img.clientWidth; //this is image width var height = img.clientHeight; //this is image height
Question: How to Format a number with exactly two decimals in JavaScript?
Use return true to exit from loop. For Example:
var num = 6.42003; alert(num.toFixed(2)); // "6.42"
Question: How to prevent buttons from submitting forms?
Use return true to exit from loop. For Example:
Best Related Posts are Following:
- javaScript encodeURIComponent function - Encode and Decode.
- Javascript Questions And Answers for Fresher and Experienced.
- Javascript Interview Questions And Answers for 4 year experienced.
- Javascript Interview Questions And Answers for 3 year experienced.
- How to bookmarks a web page with JavaScript.
- Object Oriented JavaScript interview questions and answers for experienced.
- What are differences between $(document).ready and $(window).load?.
- Javascript Interview Questions and Answers for Experienced 2.
- Javascript Interview Questions and Answers for Experienced.
- How do I copy to the clipboard in JavaScript?.
- Difference between encodeuri and encodeuricomponent in javascript?.
- What is the Correct content-type of JSON and JSONP?.
- How to Call a javaScript function in PHP.
- Backbone Js interview questions and answers.
- Front End Developer Interview Questions and Answers.
- Json Interview Questions And Answers For Freshers.
- Javascript Interview Questions and Answers.
Subscribe to:
Posts
(
Atom
)