I want to set a slideshow with random attachment images uploaded by users. Now I use this script but I need url image with jpg/png/gif extension and not file.php?id=012345
SELECT att.attach_id
FROM phpbb3_attachments att
WHERE att.mimetype='image/jpeg'
image shows like
http://www.domain.com/board/download/file.php?id='.$row['attach_id'].'&mode=view
There are alternative to display url with image extensions? Or convert this link donwload/file.php?id=1234 in a simple image file?
Merci
phpBB renames files on upload for two reasons. First is security, secondly it means two files with the same name are able to be uploaded.
Because of this, it is not possible to directly link to the original filename.
If you would like to get the file name that is on the server and the name it was uploaded as you can run the following SQL query:
SELECT physical_filename, real_filename FROM phpbb3_attachments WHERE attach_id = 'xxx'
...where xxx is the attachment id (download/file.php?id=xxx)