...

View Full Version : remove space from during uploading files



shajiuddin
01-09-2012, 10:24 AM
Hi,

I am uploading files into directory and store file name in mysql database

for selecting file for uploading having spaces like (abc def.jpg)

I need to remove space and save into directory and also in mysql database like (abcdef.jpg)

I used str_replace but I failed to achieve my need

Please help me about it

regards

BluePanther
01-09-2012, 10:52 AM
str_replace is the function you want. How were you using it?

shajiuddin
01-09-2012, 10:57 AM
sorry you didn't understood my requirement

for example I am uploading a file with name which is showing space (abc def.jpg)

during uploading I need to remove the space from file name like this (abcdef.jpg)

BluePanther
01-09-2012, 01:35 PM
sorry you didn't understood my requirement

for example I am uploading a file with name which is showing space (abc def.jpg)

during uploading I need to remove the space from file name like this (abcdef.jpg)

I understood your requirement perfectly. $_FILES['input']['name'] will equal 'abc def.jpg' in your example. So, you should do this:


$name = str_replace(' ','',$_FILES['input']['name']);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum