Skip to main content
robertm1034314
Participant
May 14, 2018
Question

CF12 using the cfzip and files to zip are on virtual drive, cfzip will not work

  • May 14, 2018
  • 3 replies
  • 800 views

We upgraded from CF10 to CF12 and some drive configurations and now CFZIP code no longers works.

The files we are trying to zip are now on a virtual drive, which I have setup on the IIS webserver, where as the old location

was  a drive attached to the webserver and assigned a local drive letter.

Do the old location was like e:\logs\filename.ext

the new location is something like http:\\webserver\logs1\filename.ext ( where logs1 is the virtual drive )

No matter what I am getting a basically file not found error when trying to access the virtual drive.

Any help would be greatly appreciated, Note, I am not the expert coldfusion programmer...

Regards

    This topic has been closed for replies.

    3 replies

    robertm1034314
    Participant
    May 15, 2018

    Thanks Mr. Watts and Wolfshade.

    I will play with that and see what happens, my concern is some of these files can be rather large, so 1st glance it would seem troublesome to go get the files and move them to a local drive, write them, then zip them, then server them out to the requestor, then

    delete the files, I think I would have to put some sort of limiter on the number of files they could select at 1 time.

    Interesting situation...

    R

    WolfShade
    Legend
    May 15, 2018

    You wouldn't necessarily have to place the zip file on the server for the user to download.  Once the zip file is created, you don't have to save it to disk, you can keep it in memory and offer it to the user for download.  This saves disk space, and you don't have to delete the zip after the user downloads it.  (Theoretically)

    My theory is incorrect.  Apparently, with CFFTP you _have_ to save to disk.  There is no keeping it in memory like I did with the upload form.    But you don't have to put it back on the server via CFFTP, you can save it locally and offer it to the user for download, then erase it.

    ^ _ ^

    robertm1034314
    Participant
    May 14, 2018

    This works:

    <cfzip file="c:\perflogs\test.zip" source="c:\perflogs\#ccounty#\#cfilename#" >

    so if I have a virtual directory on the webserver setup as logs1 lets say, and assuming the cf user account has access

    and rights to that location, I should be able to access and zip the files from that source?

    something like

    <cfzip file="c:\perflogs\test.zip" source="http:\\webserver\logs1\#ccounty#\#cfilename#" >

    Thank you

    R

    Community Expert
    May 14, 2018

    No, I don't think that CFZIP has HTTP client functionality built into it. It's looking for a filesystem location as a source. HTTP is not a filesystem location. Creating virtual directories in IIS does not create filesystem locations, it just lets HTTP clients reference files that happen to be somewhere else than on your physical IIS web root.

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC
    robertm1034314
    Participant
    May 14, 2018

    Thats my issue how do I access the virtual drive with the cfzip.

    This works fine with other cf tags

    <cfcontent type="image/tif" deleteFile = "no" file = "http://webserver/logs1/#county#/#A#" >

    it will serve up the image all day long, but it will NOT work with the CFZIP tag.

    R

    Community Expert
    May 14, 2018

    First: ColdFusion, like every other program in Windows, runs with the user rights of a specific user. When you log on and run a program yourself, that program runs with your user rights. Since ColdFusion runs as a service, it runs with the user rights of some service-specific user account or security context. By default, that is "Local System", which has very extensive local permissions, but doesn't have any network permissions. That security context can't log into remote filesystems. You can resolve this by creating a new user account that does have access to these filesystems, then configuring ColdFusion to run using that account. That account will need a minimal set of permissions to allow CF itself to run, and this is documented pretty well in the various ColdFusion security/hardening guides on the Adobe site.

    Second: I'm not sure exactly what you mean when you say the new location is accessed via HTTP. That will let you read files via an HTTP client, but will not let you access files as if they were on a local or remote filesystem. HTTP is not a filesystem. For CF to access them, once you resolve the permissions issue mentioned above, they'd have to be on a remote filesystem that you could access via "net use".

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC