I am building a system that keeps information about people. It is crucial that I give customers the chance to upload their photographs. I would like to know how I could achieve this, and show their pic with their record once they have uploaded the file. Thanks for this help, and if it is possible, I'd like to find a way to check the images before they can be viewed by other customers.
May 10, 1999, 5:17 PM
User (85 posts)
May 10, 1999, 5:17 PM
Post #2 of 15
Views: 3452
Several ways to do it. Seems like you have at least 3 issues. 1. Making the photo available with the record. 2. Having customers upload the photo and 3. You reviewing the photo prior to going online.
I'll address only number one: the way I do it is to have a field in the record for the name of the photo. Then in the html which is generated I use: <IMG SRC="../../../photos/$rec{'Photo2'}" BORDER=0 > where ../../../photos is the directory where the photos are uploaded to on the server and $rec{'Photo2'} is the name of the field in the record where the customer or whomever inputs the name of the photo file. Works well for me.
You can have the customer input the name of his/her photo and it will be displayed however you format the record for display.
If you want to review the photo first, I suggest you create another directory for upload where you can review and then transfer the photo once approved to the directory that the html points to.
I'll address only number one: the way I do it is to have a field in the record for the name of the photo. Then in the html which is generated I use: <IMG SRC="../../../photos/$rec{'Photo2'}" BORDER=0 > where ../../../photos is the directory where the photos are uploaded to on the server and $rec{'Photo2'} is the name of the field in the record where the customer or whomever inputs the name of the photo file. Works well for me.
You can have the customer input the name of his/her photo and it will be displayed however you format the record for display.
If you want to review the photo first, I suggest you create another directory for upload where you can review and then transfer the photo once approved to the directory that the html points to.
May 10, 1999, 7:50 PM
Veteran / Moderator (8669 posts)
May 10, 1999, 7:50 PM
Post #3 of 15
Views: 3454
I have just written a modification that will allow users to upload a graphic file when they add a record. I'm not really advertising it yet, because I'd like to know who has it and if they have any problems with it before I go on. If you're interested, write to me at deni@jpdeni.com and I'll let you know how to get the mod.
As for your previewing it before it is available for all to see, you could have a "Validated" field that would be admin only and set to "No" by default. Then you could come in and do a search for all records that have "No" in the "Validated" field, check out that the record and graphic are okay, and change the "Validated" field to "Yes."
To prevent others from seeing unvalidated records, add a hidden field on your search form:
<input type="hidden" name="Validated" value="Yes">
------------------
JPD
As for your previewing it before it is available for all to see, you could have a "Validated" field that would be admin only and set to "No" by default. Then you could come in and do a search for all records that have "No" in the "Validated" field, check out that the record and graphic are okay, and change the "Validated" field to "Yes."
To prevent others from seeing unvalidated records, add a hidden field on your search form:
<input type="hidden" name="Validated" value="Yes">
------------------
JPD
May 11, 1999, 3:24 AM
Novice (36 posts)
May 11, 1999, 3:24 AM
Post #4 of 15
Views: 3459
Your advice about hidden field for checking validation seems great. But I would like to allow people to view unvalidated records, although I would not show the unvalidated field, that is, the image. Guess I could achieve that with an IF ... THEN using this validation field.
I'm interested in the modification, already emailed JPdeni
I'm interested in the modification, already emailed JPdeni
May 11, 1999, 6:58 AM
Veteran / Moderator (8669 posts)
May 11, 1999, 6:58 AM
Post #5 of 15
Views: 3457
Okay. You can do that, too.
In html_record, where the graphic would display, use
if ($rec{'Validated'} eq "Yes") {
[print out graphic]
}
I got two requests for the graphic upload mod. I'm assuming one of them was yours. The links to pick up the files have been sent.
------------------
JPD
In html_record, where the graphic would display, use
if ($rec{'Validated'} eq "Yes") {
[print out graphic]
}
I got two requests for the graphic upload mod. I'm assuming one of them was yours. The links to pick up the files have been sent.
------------------
JPD
May 13, 1999, 11:45 AM
Novice (36 posts)
May 13, 1999, 11:45 AM
Post #8 of 15
Views: 3445
Well, I'm proud to tell you that it has worked fine for me. Thanks Carol, you have been great. I would have dumped DBMan if it wasn't for your help. The only little bug that I see is that you can click the upload image button when the field is blank and that takes you to the upload success page. But I think that bug is no big deal.
Mar 6, 2000, 2:12 PM
User (50 posts)
Mar 6, 2000, 2:12 PM
Post #10 of 15
Views: 3439
I want to have several images in a record for display. I am not concerned with the upload mod at this time, I will upload the files manually. I am using Tim Ryan's templates and I have not been able to get an image to display.
I have followed pabloa's instructions. Question: is that the path to the file and not the URL? <I have tried both>. Do I need to add something to dbm_html_templates.pl?
Thank you
I have followed pabloa's instructions. Question: is that the path to the file and not the URL? <I have tried both>. Do I need to add something to dbm_html_templates.pl?
Thank you
Mar 6, 2000, 2:15 PM
Veteran (17240 posts)
Mar 6, 2000, 2:15 PM
Post #11 of 15
Views: 3480
If the IMAGE field is in a field in your default.cfg file, then all you have to do is add the following tag in the html_record.html file:
Now...if it is a variable that you have defined...then you need to define the image variable in the sub html_record routine in the dbm_html_templates.pl file as tag, like the following:
Then use the same tag as above.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Code:
<img src="<%Image%>">Now...if it is a variable that you have defined...then you need to define the image variable in the sub html_record routine in the dbm_html_templates.pl file as tag, like the following:
Code:
Image => $image,Then use the same tag as above.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Mar 6, 2000, 2:54 PM
User (50 posts)
Mar 6, 2000, 2:54 PM
Post #12 of 15
Views: 3451
This is from default.cfg:
'Photo page URL' => [21, 'alpha', 20, 255, 0, '', ''],
This is from html_record.html:
<img src="<%Photo page URL%>" BORDER=0 width="299" height="165" >
And this is what gets returned in a browser when doing a view or modify:
<img src="" BORDER=0 width="299" height="165" >
and still no image. DO you see an error?
thanks
'Photo page URL' => [21, 'alpha', 20, 255, 0, '', ''],
This is from html_record.html:
<img src="<%Photo page URL%>" BORDER=0 width="299" height="165" >
And this is what gets returned in a browser when doing a view or modify:
<img src="" BORDER=0 width="299" height="165" >
and still no image. DO you see an error?
thanks
Mar 6, 2000, 3:25 PM
Veteran (17240 posts)
Mar 6, 2000, 3:25 PM
Post #13 of 15
Views: 3476
Well, in your modify template files (html_record_form.html), you must include the following:
Hope this helps.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Code:
<img src="<%Photo page URL%>" value ="<%Photo page URL%>" BORDER=0 width="299" height="165" >Hope this helps.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums