Link to home
Start Free TrialLog in
Avatar of Mahen Singh
Mahen Singh

asked on

C# Image Problem

when I save a record with Image, it will save perfectly but when I updated the record again for Image it will say System.IO.IOException: "The file exists" on windows 7 64 bit . The installation directory is with read only attribute , I tried the best to remove this attribute but could not make it.
Can u help me out
Avatar of Mahen Singh
Mahen Singh

ASKER

ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am doing in same way.. but in some cases this error occurs ....I have also attached the screenshot
Well, the program files folder is definitely not the place to store user files, so try playing by the rules and use %localapppath%.

/gustav
Can u explain it with detail.. did not get your point exactly..?
Try to save your files in a sub folder of the %localappdata%.

The Program Files folder is not intended for this purpose.

/gustav
There must be solution.. I think , if we install on client machine it would be installed on program file directory..
No. Normal user rights doesn't grant right to save anything in the Program Files folder. You need Admin rights, and a normal user should never be required to run your application with admin rights.

It's up to you to control the installation.
k.. then how to give the rights to normal user ....like admin rights. In that case it wont be a prob.
You can set your application to require admin rights. That will pop the usual warning message and ask the user for credentials for an admin account.
But to save some pictures, this is bad practice and should be avoided. Again, use %localappdata% for storing user documents and files.

/gustav
Question was answered.