php - Avoid replacing of space in filename with underscore while uploading -


I have a form in Codeigniter that I am uploading a file. If the file has a location in the name: Image (1) .jpg Then, uploading it to the secure folder as images_ (1) .jpg . How to avoid it? I want to upload it with the same name as Image eg: Picture (1) .jpg .

  $ config1 ['upload_path'] = './secure/'. $ Lastid; $ Ext = end (Explosion (".", $ _FILES ['thumb_image'] ['name'])); $ Config1 ['file_name'] = Trim ($ _ files ['thumb_is'] ['name']); $ Config1 ['permission_type'] = 'jpg | Png | Jpeg | Gif | Bmp | Jpe | Tiff | Tif '; $ This- & gt; Load-> Library ('upload', $ config1); Can anyone help me solve this problem? Thanks in advance.   

Try $ config ['remove_spaces'] = FALSE;

Otherwise, look in the original upload library, where you have the $ this-> file_name = preg_replace ("/ \ s + /", "_", $ this-> File_name); In the do_upload method you can change.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -