FTP Database and Pictures

G

Guest

I'm using FTP to allow a user to upload and overwrite a database and a folder
with images referenced in the database. I only want the user to upload to
one specific folder and not have any access to the rest of the website. So,
I created a folder named "ftp". Inside that folder is another folder for the
pictures called "dbpictures" and the "fpdb" folder that holds the database.

No matter what path I put in the database to reference the picture - unless
it is in the image folder, it will not display. In other words - if I put "
images/pict1.jpg " in the database field and save the picture to the image
folder it displays. But, if I put " ftp/dpictures/pic1.jpg " - or any other
location - it will not display. I really don't want to give the user access
to anything except the folder I named "ftp". Any idea what I may be doing
wrong with the path....or do the pictures always have to be in the image
folder for some reason?
 
T

Thomas A. Rowe

The path must be based on the location of the page that is displaying the images to the location of
the images within the web, not from the location of the database.

Suggest storing just the image file names in the database and on the display page call the image
name from the database field, like so:

<img border="0" src="../ftp/dpictures/<%=objRS("ImageField")%>" alt="<%=objRS("ImageTitle")%>"
Title="<%=objRS("ImageTitle")%>">

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
G

Guest

Thank you for your response to my questions. I'm sorry I don't understand
what you're saying with the following suggestion ...

<img border="0" src="../ftp/dpictures/<%=objRS("ImageField")%>"
alt="<%=objRS("ImageTitle")%>"
Title="<%=objRS("ImageTitle")%>">


The html line currently reads... "
<p><b>Picture:</b> <img border="0"
src="<%=FP_FieldLink(fp_rs,"SmallPicture")%>"></p>
"

After your response I tried to replace it with..."
<p><b>Picture:</b> <img border="0"
src="../ftps/dbpictures/<%=objRS("SmallPicture")%>"></p>
"
and tried with..."
<p><b>Picture:</b> <img border="0"
src="../ftps/dbpictures/<%=objRS("SmallPicture")%>"
alt="<%=objRS("ImageTitle")%>"
Title="<%=objRS("ImageTitle")%>">

But, don't know what to put in "ImageTitle" and I get the folloiwng error on
the page when trying to view it...

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'objRS'

/pictest.asp, line 120

I understand what to put in "ImageField" (the db field name)...., but don't
know what I'd put in "Image Title". This entire page is a listing with only
database results. No one would go in and make any additions or changes on
the pages once the results are setup there. Only the database would be
updated and upload again.
 
T

Thomas A. Rowe

Try the following format:

<p><b>Picture:</b> <img border="0"
src="../ftps/dbpictures/<%=FP_FieldLink(fp_rs,"SmallPicture")%>"></p>

The SmallPicture field in the database must only contain the filename of the image, not the path, to
work with the above.


The best way to get the actual path to the image, is to open the page that the image will be
displayed on in FP, then drag a picture from the dbpicture folder onto the bottom of the page, then
switch to HTML/Code view and copy the path into the example above and replace the picture file name
with the call (<%=FP_FieldLink(fp_rs,"SmallPicture")%>) to the database.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top