File Upload and allowed type |
[eluser]meer[/eluser]
its working fine here i have coppied your code and made some modifications , its completely working here Code: <?php
[eluser]satie[/eluser]
No, for me doesn't work. I resolve creating a function (in /application/library/) that controls extentions AFTER uploading. and if returns FALSE delete the file. Code: // example $nome_immagine = "ciccio.jpg" AND $estensioni = "jpg|gif" Thanks for your interest. I appreciated.
[eluser]Unknown[/eluser]
Have a similar problems. With Code: $config['allowed_types'] = 'csv'; always error "The filetype you are attempting to upload is not allowed.", but MIME types is Ok. With CI 2.03 I haven't that problem, but after upgrading to CI 2.10 it have.
[eluser]weboap[/eluser]
http://stackoverflow.com/questions/74954...s-not-allo i don't advise to modify the core files, extend the library or copy the specific file to your library folder.
[eluser]satie[/eluser]
Ok. I restored the original file Upload.php in ./system/libraries And the problem persists. So upload works if I use Code: $config['allowed_types'] = '*'; and It doesn't work if i use: Code: $config['allowed_types'] = 'gif|jpg|png'; I create a new function in ./applications/libraries because I'm asking and finding everywhere to know why the problem persists if I specify allowed type. It wasn't my intention to modify core files: I use a framework to have a safe code.
[eluser]satie[/eluser]
I just activated log files on CI. After uploading images the log file reports: ERROR - 2012-06-08 11:57:00 --> Severity: Warning --> getimagesize(): open_basedir restriction in effect. File(C:\Windows\Temp\php69EF.tmp) is not within the allowed path(s): (d:\inetpub\vhosts\website.it\httpdocs\) D:\inetpub\vhosts\website.it\httpdocs\annunci\system\libraries\Upload.php 672 ERROR - 2012-06-08 11:57:00 --> Severity: Warning --> getimagesize(C:\Windows\Temp\php69EF.tmp): failed to open stream: Operation not permitted D:\inetpub\vhosts\website.it\httpdocs\annunci\system\libraries\Upload.php 672
[eluser]satie[/eluser]
The Server Technicians resolved this issues changing open_basedir in php ini BEfore: Code: d:\inetpub\vhosts\mywebsite.it\httpdocs\; AFTER: Code: d:\inetpub\vhosts\mywebsite.it\httpdocs\;C:\windows\temp But they suggest to avoid to include C:\windows\temp directory in base_dir: this configuration is not secure. They suggest to configure in system/libraries/Upload.php of CI with different directory to save tmp file. (for example in CI application. This way permits to configure open_basedir with DOCROOT) But is it possible? Or this is a Windows configuration? Thanks. |
Welcome Guest, Not a member yet? Register Sign In |