Separate gif and jpeg from body

Results 1 to 2 of 2

Thread: Separate gif and jpeg from body

  1. #1
    Join Date
    Dec 1969

    Default Separate gif and jpeg from body

    Hello,<BR><BR>I can&#039;t get this to work properly. I&#039;ve been thru all the old posts and FAQs, and I solved it on my local server (running VBS 5.5) but my web server is running 5.1 Anyway, I need to get the image name and full path name for all .jpg and .gif submitted from a form. If each image is separated by text it seems to work but two adjacent gifs in the "text" are shown as a single gif. The code is below, the bit that is killing me is the dictionary object part:<BR><BR>strHTML="&#060;html&#062;&#060;body&# 062;&#060;IMG src=""C:My DocumentsASP 101 - Quick Tips_filesAspConnSpring2001_125x50.gif""&#062;&#06 0;IMG src=""C:My DocumentsASP 101 - Quick Tips_filesdna-468x60.gif""&#062;&#060;/body&#062;&#060;/html&#062;"<BR><BR>Dim objDict<BR>Set objDict = Server.CreateObject("Scripting.Dictionary")<BR> <BR>&#039;Assign image type substrings to dictionary object<BR>objDict.Add "1", "img(.*)gif" &#039;this is the **!* bit<BR>objDict.Add "2", "&#060;IMG + *.jpg&#062;"<BR>objDict.Add "3", "&#060;IMG *.jpeg&#062;"<BR><BR>Set re = new RegExp &#039; creates the RegExp object <BR>re.IgnoreCase = true <BR>re.Global = true<BR>For Each Key in objDict<BR><BR> re.Pattern = objDict(Key)<BR> Set Matches = re.Execute(strHTML) <BR> Response.Write "KEY IS " & server.HTMLEncode(objDict(Key)) & "<BR>"<BR>For Each item in Matches <BR> Response.Write " match is " & server.HTMLEncode(item.Value) & "<BR> " <BR> pimage =UCASE(item.Value)<BR> pimage=replace(pimage,"&#060;IMG SRC=""","")<BR> pimage=replace(pimage,"""&#062;","")<BR><BR>etc. etc.<BR><BR>How can I make it find each gif separately?!! I tried to pick up the .gif"&#062; but couldn&#039;t do it!

  2. #2
    Join Date
    Dec 1969

    Default RE: Separate gif and jpeg from body

    How do you get the source??<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts