Upload File type and name
Posted: 04 Oct 2009, 17:14
May be... it's my misunderstanding.
Does Phoca-Gallery accept only jpeg file?
When I upload non-jpeg file such as gif,png, Phoca Gallery shows error message in the control panel.
Then blank(or broken) picture is shown in the front gallery.
I think Phoca-Gallery should void non-jpeg file when it's uploaded.
Second, I think some people wanna upload same(or reviced) picture couple of times.
So renaming uploaded file to unique file name is convinient.
Therefore I added the code below in the file "/controllers/category.php" line 400.
if(strpos($file['name'],'.jpg')!==false){$file['name']=uniqid('p').'.jpg';} else{unlink($file['tmp_name']);}
Is this unnecessary? If Phoca-Gallery already has this function, please tell me proper way to use it.
I'm using v.2.5.8
Does Phoca-Gallery accept only jpeg file?
When I upload non-jpeg file such as gif,png, Phoca Gallery shows error message in the control panel.
Then blank(or broken) picture is shown in the front gallery.
I think Phoca-Gallery should void non-jpeg file when it's uploaded.
Second, I think some people wanna upload same(or reviced) picture couple of times.
So renaming uploaded file to unique file name is convinient.
Therefore I added the code below in the file "/controllers/category.php" line 400.
if(strpos($file['name'],'.jpg')!==false){$file['name']=uniqid('p').'.jpg';} else{unlink($file['tmp_name']);}
Is this unnecessary? If Phoca-Gallery already has this function, please tell me proper way to use it.
I'm using v.2.5.8