Click to See Complete Forum and Search --> : .NET Permissions Issues (I think)


compbrat75
12-23-2010, 03:23 PM
Hello,

Long time Unix/Linux web programmer, beginner ASP.NET/VB programmer...

Operating: 32Bit Win 7, IIS 7.5

I'm attempting to use ImageMagick to convert a tif image on one mapped server to a gif image on another mapped server.

When I run the ImageMagick convert command from the cmd prompt, the process completes just fine with my user credentials.

When I create an ImageMagick object in ASP.NET, I can successfully convert the images if they are local on my machine.

I cannot get the script to execute properly using the mapped drives. I do not believe this is an issue with ImageMagick. I believe it is a permissions issue.
I have given IUSR read access to the folders with the tif images, write access to the gif images, read/write to the windows\temp folder on my machine (needed for ImageMagick) and read/execute to the Program Files\ImageMagick folder where the exe is.

Here is the code which works fine on if the files are on the local machine:

ASP.NET with VB

<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="utf-8" aspcompat=true%>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="Microsoft.VisualBasic" %>
<%@ import Namespace="System.Drawing" %>
<%@ import Namespace="System.Drawing.Image" %>
<%@ import Namespace="System.Drawing.Drawing2D" %>

...other unrelated working code...

Dim imageMagick As Object = Server.CreateObject("ImageMagickObject.MagickImage.1")

Dim tifImg As String = "c:/imagenamewithfullpath.tif"
Dim gifImg As String = "c:/imagenamewithfullpath.gif"

Dim msgs As String = imageMagick.Convert(tifImg, gifImg)

Problem Code:

Dim imageMagick As Object = Server.CreateObject("ImageMagickObject.MagickImage.1")

Dim tifImg As String = "j:/imagenamewithfullpath.tif"
Dim gifImg As String = "k:/imagenamewithfullpath.gif"

Dim msgs As String = imageMagick.Convert(tifImg, gifImg)

Any advice/help would be very much appreciated!
Thanks,
~Maria

Ribeyed
01-13-2011, 09:30 AM
Hi there,

It does look like permission issues possibly becuase of the UAC settings in windows 7. You didn't mention if you tried switch the UAC off.

Control pannel > User Accounts > Select user > Change User Account Control settings

move slider to Never notify. reboot your machine.

Also try elevate VS to administrator, run your code, see if that has solved your problem.


Of course this its not a fix but it will help eliminate the UAC security issues.


regards

Ribs

mmrcela
01-19-2011, 02:51 PM
Hi Compbrat 75 & Ribeyed,
I am looking for a full time permanent Software Developer to work for our company in Illinois. If either of you know of anyone who is looking to make a company change please let me know.

Thanks!