DFP uploads - 2 extensions jpg.jpg
Hi,
I found another thread but I'm just 'not sure' ...:-) showthread.php?t=21188
End result = I want to achieve AJAX style image refresh with a snippet of javascript:
<script type="text/javascript">
var reimg
window.onload=function () {
reimg=document.getElementById('re')
setInterval(function () {
reimg.src=reimg.src.replace(/\?.*/,function () {
return '?'+new Date()
})
},5000)
}
</script>.......This works.
I have 6 upload fields.
I have a database with 6 image columns named: image1, image2, image3 . . .
Each column is populated with the filenames: image1.jpg, image2.jpg, image3.jpg, depending on the column.
I have set DFP to convert to jpg and overwrite existing files and on the second page of the wizard I have set the filename dynamically to the name of the corresponding binding (image1) coming from the recordset. (not the WA DFP bindings)
Uploads work fine into a folder created with mkdir() which gets it's name from the cust_id field of the recordset. Each user gets custom folder: /galleries/var cust_id/image1.jpg, image2.jpg etc.
My issue is that when I look into the folder the images are there but they have double extensions i.e. image1.jpg.jpg etc., and they don't display on the page.
Any light on what I may be doing wrong?
Thanks!
I noticed that DFP is appending the file extension, as I set DB field content to 'image1' (without extension) and the resulting uploaded file is called image1.jpg, but then the dynamic image src on my pages only gets the name of 'image1' (no file extension) and the image is still a no-show.
The overwrite doesn't seem to be functioning as it always seems to create a file 'image1.jpg.jpg' instead of overwriting the existing 'image1.jpg'
I suppose I could hard code the extensions into my pages but I was looking to get around that if possible.
SOLVED!!!
I just had to put the 'actual file name I wanted' into the 'filename' field on the 2nd page of the wizard. Now it overwrites and displays.