there is any way in codeigniter for increase or decrease the file upload time . Can any body explain what will be happen after execution time is over.
for example - upload video of 200MB
$config['upload_path'] = 'upload/';
$config['allowed_types'] = 'flv|mp4|3gp';
$config['max_size'] = 204800; //200 MB
$this->load->library('upload', $config);
But you should ask your server firm. and you can check php.ini.
Find this line in the php.ini file “upload_max_filesize = 2M” and replace it with a higher value (e.g. “upload_max_filesize = 64M”)
; Maximum allowed size for uploaded files.
upload_max_filesize = 2M
; Must be greater than or equal to upload_max_filesize
post_max_size = 2M
Related
I have written a code in codeigniter to write text over the image using watermarking text in CI, I have pasted the code which I have written.
$imgpath = './images/posters/'.$filename;
$newimgpath = './images/wm/'.$filename;
$config['image_library'] = 'gd2';
$config['source_image'] = $imgpath;
$config['wm_text'] = $ref_id;
$config['wm_type'] = 'text';
$config['new_image'] = $newimgpath;
$config['width'] = '50';
$config['wm_font_path'] = './media/texb.ttf';
$config['wm_font_size'] = '16';
$config['wm_shadow_color'] = '993300';
$config['wm_shadow_distance'] = '3';
$config['wm_vrt_alignment'] = 'bottom';
$config['wm_hor_alignment'] = 'center';
$config['wm_font_color'] = '#FFFFFF';
$config['wm_hor_offset'] = '350';
$config['wm_vrt_offset'] = '30';
$config['wm_padding'] = '-300';
The problem is that the text written over the image is small in size and not visible. How to increase the size of the text ? Is there any solution for this ?
Even if it is increased from 16 ,,the size of the text is not increasing. Any solution for this ?
I have changed some codes in the image library in the library folder in the system folder but it is not working.
The screenshot is included as below :
I have circled where the text has been written but the font is small.
I am working on a requirement of upload image in 'CKEditor' where the image that is uploaded should be below 2MB size. I am using 'CKFinder' for the image upload, I know that there is a 'maxSize' option for images in 'ckfinder\config.php' file, Initially maxSize=0 is there that I have changed it to '2000' and after that I tried to upload image above 2MB but still it is accepting that image to upload. I observed here what is happening whenever user uploads an image in CKEditor is It is doing image compression automatically and the 2MB or above image is getting compressed to KB's. Below is the code of config.php file:
ckeditor/ckfinder/config.php
$config['resourceTypes'][] = array(
'name' => 'Images',
'directory' => 'images',
'maxSize' => 2000,
'allowedExtensions' => 'bmp,gif,jpeg,jpg,png',
'deniedExtensions' => '',
'backend' => 'default'
);
ckeditor/config.js
CKEDITOR.editorConfig = function( config ) {
config.filebrowserBrowseUrl = "/ckeditor/ckfinder/ckfinder.html";
config.filebrowserImageBrowseUrl = "/ckeditor/ckfinder/ckfinder.html?type=Images";
config.filebrowserFlashBrowseUrl = "/ckeditor/ckfinder/ckfinder.html?type=Flash";
config.filebrowserUploadUrl = "/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files";
config.filebrowserImageUploadUrl = "/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images";
config.filebrowserFlashUploadUrl = "/ckeditor/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash";
config.language = "en";
config.uiColor = "#F7B42C";
config.height = 300;
config.toolbarCanCollapse = true
};
My questions here are, I am confused of whether 'maxSize' is in KB's or MB's in config.php file? how to restrict image maxSize to allow images equals to or below 2 MB in CKEditor? Any help would be appreciated. Thanks.
You may refer to CKFinder PHP connector official docs on resourceTypes:
The maximum size of the uploaded image defined in bytes. A shorthand notation is also supported: G, M, K (case insensitive). 1M equals 1048576 bytes (one Megabyte), 1K equals 1024 bytes (one Kilobyte), 1G equals 1 Gigabyte.
This question have been also already answered on CKEditor Github issue page.
I have a jpeg image 10,000px by 10,000px in Format24bppArgb 11MB, but after I clone it and save it as bmp in Format32bppArgb, it goes up to 500MB, any reason why?
let file = new Bitmap("planet.jpg")
let rect = new Rectangle(0, 0, file.Width, file.Height)
let img = file.Clone(rect, PixelFormat.Format32bppArgb)
img.Save("copy.bmp", ImageFormat.Bmp)
I went ahead an ran the following in FSI:
open System.Drawing
open System.Drawing.Imaging
let file = new Bitmap("planet.jpg")
let rect = new Rectangle(0, 0, file.Width, file.Height)
let img = file.Clone(rect, PixelFormat.Format32bppArgb)
img.Save("copy.bmp", ImageFormat.Bmp)
I used a blank 10,000px by 10,000px JPG file clocking in at 1,563,127 bytes according to Windows Explorer. The resulting copy.bmp is 400,000,054 bytes, which is indeed a lot bigger than the input.
As #PaulAbbott said, this is because there's no compression in bitmap files. A 10,000 by 10,000 image at 32 bits per pixel will end up being stored as 3,200,000,000 bits, which is exactly 400,000,000 bytes or roughly 400 MB - which is around the size you posted.
If the file you got really was 500 MB and not around 400 MB, could you try hosting it somewhere? I'd like to take a look at it and see if I'm missing something here.
I am facing a problem regarding file uploading in Grails.
I would like to check the file size runtime after opening from the windows explorer and give me the error message if any condition fails.
I have a file uploading window where I have 3 file choose options. I would like to check each three files not to be more than 5MB. When I click on Browse button then my system explorer opens and I choose file.
Is there any way to check file size while selecting the file using javascript/ Ajax call? And if the file size is exceeds than the explorer show again to choose another file.
About this issue, there is a plug-in called file-uploader to the rescue.
With this plug-in you can define some restrictions in config.groovy. Here is an example:
fileuploader {
avatar {
maxSize = 1024 * 256 //256 kbytes
allowedExtensions = ["jpg","jpeg","gif","png"]
path = "/tmp/avatar/"
}
docs {
maxSize = 1000 * 1024 * 4 //4 mbytes
allowedExtensions = ["doc", "docx", "pdf", "rtf"]
path = "/tmp/docs/"
}
}
How to know the size of the picked image , or how to put a limit for the picked image , like Maximum size for Image is 1 MB , Here is my code
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
openPicker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.DocumentsLibrary;
openPicker.FileTypeFilter.Add(".png");
openPicker.FileTypeFilter.Add(".Jpeg");
openPicker.FileTypeFilter.Add(".Jpg");
StorageFile file = await openPicker.PickSingleFileAsync();
Unfortunately there is no way to restrict the size of the picked file in advance.
After the file has been picked, you can call http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.storagefile.getbasicpropertiesasync.aspx to get its size.