I followed the help guide for �Uploading and Displaying Images�.
When an image is uploaded the page seems to reload, since the message that the new file has been uploaded is displayed. What is not happening is the new image won�t display in the grid until I reselect the page. The image does make it to the image table. If I hit refresh, the image is loaded again into the table so I end up with two of the same table.
The help guide says: The <%a5 ? request.script_name %> action causes the page to reload when the user clicks either of the buttons.
The following is in the <Head> section:
<%a5
dim msg as c = ""
if eval_valid("cmd")
dim fn as C
fn = "[PathAlias.ADB_Path]\client\\" + session.vFldr + "\\" + FileToUpload.filename
file.from_blob(fn, FileToUpload.data)
msg = "<a href=\"/" + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />"
tbl = table.open("[PathAlias.ADB_Path]\Images.dbf")
tbl.enter_begin()
tbl.Image = fn
tbl.Name = FileToUpload.filename
tbl.Uploaddate = now()
tbl.enter_end(.t.)
tbl.close()
end if
%>
The following is the < body> section:
<form action=" <%a5 ? request.script_name %> " method="post" enctype="multipart/form-data">
<input type="file" name="FileToUpload" >
<input type="submit" name="cmd" value="Upload File">
</form>
<%a5 ? msg %>
The question I have is should the image that was just uploaded display right after I select Upload in the grid component? Or should I not expect the image to display when the page is reloaded? Can anyone see if I am doing something wrong?
Thank you,
Bob
When an image is uploaded the page seems to reload, since the message that the new file has been uploaded is displayed. What is not happening is the new image won�t display in the grid until I reselect the page. The image does make it to the image table. If I hit refresh, the image is loaded again into the table so I end up with two of the same table.
The help guide says: The <%a5 ? request.script_name %> action causes the page to reload when the user clicks either of the buttons.
The following is in the <Head> section:
<%a5
dim msg as c = ""
if eval_valid("cmd")
dim fn as C
fn = "[PathAlias.ADB_Path]\client\\" + session.vFldr + "\\" + FileToUpload.filename
file.from_blob(fn, FileToUpload.data)
msg = "<a href=\"/" + FileToUpload.filename + "\" target=\"_blank\">" + FileToUpload.filename + "</a> was uploaded<br /><br />"
tbl = table.open("[PathAlias.ADB_Path]\Images.dbf")
tbl.enter_begin()
tbl.Image = fn
tbl.Name = FileToUpload.filename
tbl.Uploaddate = now()
tbl.enter_end(.t.)
tbl.close()
end if
%>
The following is the < body> section:
<form action=" <%a5 ? request.script_name %> " method="post" enctype="multipart/form-data">
<input type="file" name="FileToUpload" >
<input type="submit" name="cmd" value="Upload File">
</form>
<%a5 ? msg %>
The question I have is should the image that was just uploaded display right after I select Upload in the grid component? Or should I not expect the image to display when the page is reloaded? Can anyone see if I am doing something wrong?
Thank you,
Bob
Comment