• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk MapGuide Developer

    Reply
    Active Member
    Posts: 6
    Registered: ‎12-10-2003

    Usint the DAT.writeToMwfStream() with coldfusion.

    74 Views, 4 Replies
    12-09-2003 06:08 AM
    Does anybody out there use the DAT with coldfusion? I've been able to create a temporary mwf file which is delivered via but I would really like to return the mwf as a stream. Not sure how to do this...can anybody help????

    Thanks!
    Please use plain text.
    *Falconer, Navid

    Re: Usint the DAT.writeToMwfStream() with coldfusion.

    12-09-2003 07:12 AM in reply to: jebu23
    Hello,

    I'm not sure what you are asking for. If you already are using the
    tag to deliver the mwf then you are streaming it to the user.
    What is the functionality you are trying to develop?

    Are you perhaps wondering if there is a way to stream it to the user without
    having to save the file to the server's filesystem first? With Coldfusion
    this is not possible (at least not as of version 5.0). It was a big
    complaint among developers, but there is no simple workaround without using
    a third party tool.

    Navid


    "jebu23" wrote in message
    news:f1a4f94.-1@WebX.maYIadrTaRb...
    Does anybody out there use the DAT with coldfusion? I've been able to create
    a temporary mwf file which is delivered via but I would really
    like to return the mwf as a stream. Not sure how to do this...can anybody
    help????
    Thanks!
    Please use plain text.
    Active Member
    Posts: 6
    Registered: ‎12-10-2003

    Re:

    12-10-2003 12:17 AM in reply to: jebu23
    Thanks Navid??

    That was exactly what I was looking for. I've been able to deliver the map but as you said, I had to save it to the file system first.

    I can't imagine how many countless hours I could have spent trying to track that one down!! Thank you!!

    I'm wondering though...I just got back from Autodesk University where I took a class from Gorden Luckett on customizing mapguide useing the Dynamic Authoring Toolkit. I asked about useing the WriteToMwfStream() method and he indicated that it was possible although he didn't have any code to demonstrate...

    Well, thanks again!!

    Jade
    Please use plain text.
    *Morsell, Andy

    Re:

    12-12-2003 03:49 AM in reply to: jebu23
    Take a look at Example 2 in the Dynamic Authoring
    Toolkit Examples directory.  The main map file (map.htm) just uses a
    standard map embed statement as follows:

     

    <object ID="map" WIDTH="100%"
    HEIGHT="100%"
       
    CLASSID="CLSID:62789780-B744-11D0-986B-00609731A21D"
       
    CODEBASE=
     "
    href="ftp://adeskftp.autodesk.com/webpub/mapguide/ver6/viewer/en/mgaxctrl.cab">ftp://adeskftp.autod...
    ">
       
    <param name="URL" value="basemap.asp">
        <embed
    src="basemap.asp" Name="map" width="100%"
    height="100%"
     pluginspage=
     "
    href="ftp://adeskftp.autodesk.com/webpub/mapguide/ver6/viewer/en/mp60.exe">ftp://adeskftp.autodesk....
    ">
    </object>

     

    Note that the embed is actually executing the
    basemap.asp who's code ends with the following:

     

    ' Return the binary MWF
    information
    Response.Expires = -1
    Response.Buffer =
    TRUE
    Response.ContentType =
    "application/x-mwf"
    Response.BinaryWrite(mwfDoc.WriteToMwfStream())

    Response.End

     

    No MWF is ever written to the file system in this
    case.  Pretty slick.

     


    --
    Andy Morsell, P.E.
    Spatial
    Integrators, Inc.

    href="http://www.spatialgis.com">http://www.spatialgis.com




    style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">Thanks
    Navid??

    That was exactly what I was looking for. I've been able to deliver the map
    but as you said, I had to save it to the file system first.

    I can't imagine how many countless hours I could have spent trying to track
    that one down!! Thank you!!

    I'm wondering though...I just got back from Autodesk University where I
    took a class from Gorden Luckett on customizing mapguide useing the Dynamic
    Authoring Toolkit. I asked about useing the WriteToMwfStream() method and he
    indicated that it was possible although he didn't have any code to
    demonstrate...

    Well, thanks again!!

    Jade

    Please use plain text.
    *Falconer, Navid

    Re:

    12-12-2003 04:39 AM in reply to: jebu23
    Yes, that's a great example of how it should be done. Unfortunately
    Coldfusion doesn't support sending this stream directly to the user's
    browser without first saving the stream to a temporary file, which is
    possible in other environments such as ASP and ASP.NET among others. This
    is unfortunate because writing to the disk upon each map creation is not a
    great solution and would be somewhat of a wear upon the hard drive over
    time.

    Navid
    "Andy Morsell" wrote in message
    news:47171F4883A73CC54914B136FB7D5D8A@in.WebX.maYIadrTaRb...
    Take a look at Example 2 in the Dynamic Authoring Toolkit Examples
    directory. The main map file (map.htm) just uses a standard map embed
    statement as follows:


    CLASSID="CLSID:62789780-B744-11D0-986B-00609731A21D"
    CODEBASE=
    "ftp://adeskftp.autodesk.com/webpub/mapguide/ver6/viewer/en/mgaxctrl.cab">


    pluginspage=
    "ftp://adeskftp.autodesk.com/webpub/mapguide/ver6/viewer/en/mp60.exe">


    Note that the embed is actually executing the basemap.asp who's code ends
    with the following:

    ' Return the binary MWF information
    Response.Expires = -1
    Response.Buffer = TRUE
    Response.ContentType = "application/x-mwf"
    Response.BinaryWrite(mwfDoc.WriteToMwfStream())
    Response.End

    No MWF is ever written to the file system in this case. Pretty slick.


    --
    Andy Morsell, P.E.
    Spatial Integrators, Inc.
    http://www.spatialgis.com

    "jebu23" wrote in message
    news:f1a4f94.1@WebX.maYIadrTaRb...
    Thanks Navid??
    That was exactly what I was looking for. I've been able to deliver the map
    but as you said, I had to save it to the file system first.
    I can't imagine how many countless hours I could have spent trying to track
    that one down!! Thank you!!
    I'm wondering though...I just got back from Autodesk University where I took
    a class from Gorden Luckett on customizing mapguide useing the Dynamic
    Authoring Toolkit. I asked about useing the WriteToMwfStream() method and he
    indicated that it was possible although he didn't have any code to
    demonstrate...
    Well, thanks again!!
    Jade
    Please use plain text.