Be the first to write a review
Pure ASP Upload 3 Review by James Threadgill
In this tutorial we will look at how to take your image handling options to the limit
DMXzone’s Pure ASP Upload is one of the best Tools I have for creating dynamic web sites. I’ve been using it over ten years. But there’s never really enough? Is there? Dreamweaver is a great tool for creating dynamic website, but if you want to get the most out of Dreamweaver and tools like DMXzone Pure ASP Upload, you have to reach under the hood and get your hands dirty by fine-tuning your code. With a little hand coding, however, there is no reason your applications cannot be as powerful and feature packed as any available.
Bonus: Displaying Images Using the File Scripting Object
Earlier in this tutorial I mentioned using the file scripting object to prevent the dreaded red X when displaying and image. This is the method I use. Notice that I close the ASP script block before the image tag and start a new script for the closing End If. If you do it this way Dreamweaver will display the image placeholder in design view. If you put it all in one script block and use the Response.Write() method to display the image you will not see the image placeholder in design view.
<%Set objFileSystem = Server.CreateObject("Scripting.FileSystemObject")
objFile = Request.ServerVariables("SCRIPT_NAME")
ImageFolder = Server.MapPath("../site_images\")
ImagePath = ImageFolder & "\" & (rs_links.Fields.Item("Link_Image").Value)
If objFileSystem.FileExists(ImagePath) then%>
<a href="http://<%=(rs_links.Fields.Item("Link_URL").Value)%>" target="_blank">
<img src="../site_images/<%=(rs_links.Fields.Item("Link_Image").Value) %>" hspace="5" vspace="5" border="0" alt="Link Image" /></a>
That's all there is to it. In this tutorial you learned how to toggle the skip empty fields feature of Pure ASP Upload, and how to delete the image using the file scripting object to access the server's file system. In the next part of this series, "Taking it to the Limit with Pure ASP Upload 3.0." we will learn how to handle multiple images and sequential images using the For… Each loop. You also learned to prevent the red X of missing images on your site front end using the file scripting object.
James Threadgill has authored numerous tutorials on ASP and ASP.NET web development, published on such sites as the Dynamic Zones and MSDN Accademic Alliance. He co-authored the Sam's book Dreamweaver MX: ASP.NET Web Development.
James first began computer programming in 1995 while attending Alvin Community College. He completed a certificate of computer science program and an Associate of Arts degree at Alvin before going on to the University of Houston-Clear Lake where he was awarded a Bachelor of Science and a Master of Arts.
James publishes fiction, poetry, and visual arts under the name Wayne James. His fiction first appeared in Raconteur in 1995 and since has been published numerous times: in Hadrosaur Tales 5 and 7, Bayousphere, and in the Write Gallery e-zine. His poetry first appeared in the small press magazine Lucidity in 1996 and has been published numerous times since. His collection of fiction and poetry, When Only the Moon Rages, was released in 2000. Most recently his work appeared in Tales of the Talisman winter 2010 and spring 2011 issues. James currently attends graduate school at the University of Houston and owns and operates small web design and internet marketing firm, WWWeb Concepts, with his wife, Karen, in Houston, TX USA.
You must me logged in to write a review.