Increase upload filesize in PHP from applicatoin

PHP calculates and displays the maximum file size that you can set based upon two PHP settings: ‘post_max_size’ and ‘upload_max_filesize’. Since ‘post_max_size’ is the limit for all the content of your post, many people choose ‘post_max_size’ to be a multiple of ‘upload_max_filesize’ to allow multiple files to be uploaded, but this is not essential. The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.

To increase maximum upload limit we need to change into PHP.ini file. Maximum file upload size that you can set based upon two PHP settings: ‘post_max_size’ and ‘upload_max_filesize’. Since ‘post_max_size’ is the limit for all the content of your post, many people choose ‘post_max_size’ to be a multiple of ‘upload_max_filesize’ to allow multiple files to be uploaded, but this is not essential. The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.
But we don’t have access into PHP.ini file while we are using a shared hostings. Still you can increase maximum upload file size from your application level. There is two way to do that. One is using PHP code and another is by .htaccess file.

Using .htaccess

Add the below to your .htaccess file in your root directory.

php_value upload_max_filesize 10M
php_value post_max_size 10M

By PHP code

Add following codes into your settings.php file

• ini_set(‘upload_max_filesize’, ’10M’);
• ini_set(‘ post_max_size’, ’10M’);

I will prefer to use .htaccess file to increase upload file size. Also you need to increase maximum executoin time for last files upload

php_value max_execution_time 300 #(default in ms)

The PHP documentation states that the memory_limit setting also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. If this is an issue, see the page on how to Increase memory available to PHP (3 methods)

How to publish blog post from Microsoft Office 2007

To publish blog post from Microsoft Office 2007 you have to follow the following steps

  1. Open Microsoft Office 2007
  2. Go Publish -> Blog from the office button. See Fig-1
  3. Then register your account here.
  4. If you using wordpress blog then change the xmlrpc server name. example: if your blog name is http://myblog.wordpress.com then your xmlrpc server name will be http://myblog.wordpress.com/xmlrpc
  5. WordPress allowed you to post an image but blogger does not allow it yet. I don’t know about other blogs because I have not tested those yet.

     

Fig – 1

Note: Your user name & password may be hacked by this time because Microsoft Office 2007 sends your user name & password each time to post and retrieve data from your blog.

Configure CURL with XAMPP

Please do the following step to configure CURl XAMPP.

For current php version

  1. Open xampp location/apache/bin/php.ini
  2. Uncomment the following line in the “Windows Extensions” section: extension=php_curl.dll
  3. Restart apache

For all version of php please enable the php_curl.dll extension for the following files

  1. xampp location/apache/bin/php.ini
  2. xampp location/php/php5.ini
  3. xampp location/php/php.ini
  4. xampp location/php/php4/php.ini
  5. xampp location/php/php4/php4.ini
  6. Restart apache

AUB 4th Convocation

9th September 2007 was a most memorable day in my life. I was attending AUB 4th convocation. I met with my AUB friends after a long time. Our honorable president had started the convocation opening ceremony. That was an important directional speech he through to us.

For View more picture click here

Add rows(with content) from modal child window to parent window

// description of code here
/*
* This is a function for put data from child window (with data)
* to parent window.
* Make a tabody by id=”addFromMarketingList” into the parent window
*/
function addToList(){
if(window.dialogArguments){
opener = window.dialogArguments;
}
openerTBody = opener.document.getElementById(“addFromMarketingList“);//parent window TBODY

for(var i=0;i<document.forms[0].elements.length;i++){
if(document.forms[0].elements[i].type==”checkbox“){
if(document.forms[0].elements[i].checked){
var parentElementTD = document.forms[0].elements[i].parentElement;
var parentElementTR = parentElementTD.parentElement;
var myTR = opener.document.createElement(“TR“);
myTR.className=”odd“;
for(var j=0;j<parentElementTR.childNodes.length;j++){
var myTD=opener.document.createElement(“TD“);
myTD.innerHTML = parentElementTD.innerHTML;
myTR.appendChild(myTD);
var parentElementTD = parentElementTD.nextSibling;
}
openerTBody.appendChild(myTR);
}
}
}
window.close();
}

Follow

Get every new post delivered to your Inbox.