filestream access denied

  • Thread starter Thread starter sham
  • Start date Start date
S

sham

Hi to all,

I have a file that when I try to open gives the exception message "Access to
path c:\data\abc.mpg is denied".

As soon as I try to do file = new FileStream(filename, FileMode.Open); the
exception is raised.

I have rebooted my machine to make sure that nothing is locking the file and
yet I always get the same error for this file.

How can I find out more on what is causing the problem with this file?

Sham.

Ps. I have opened other files is the same directory and have not had any
problems.
 
Hi,
Hi to all,

I have a file that when I try to open gives the exception message "Access to
path c:\data\abc.mpg is denied".

As soon as I try to do file = new FileStream(filename, FileMode.Open); the
exception is raised.

I have rebooted my machine to make sure that nothing is locking the file and
yet I always get the same error for this file.

How can I find out more on what is causing the problem with this file?

Sham.

Ps. I have opened other files is the same directory and have not had any
problems.

That's strange. Make sure that the ASPNET user has read (or read-write)
access to this file. To do this, use the Security dialog in Windows
Explorer (right-click on the file and choose from the context menu).

I had cases in the past where corrupt MPG files would be almost
impossible to delete even after a reboot. Maybe the file is just
invalid. Can you play it in, say, Windows Media Player?

Greetings,
Laurent
 
Hi Laurent,

The app is a normal win form app.
It plays fine in media player.

Any other clues?
Can I check any properties on the file that may help?

Sham.

Laurent Bugnion said:
Hi,
Hi to all,

I have a file that when I try to open gives the exception message "Access
to path c:\data\abc.mpg is denied".

As soon as I try to do file = new FileStream(filename, FileMode.Open);
the exception is raised.

I have rebooted my machine to make sure that nothing is locking the file
and yet I always get the same error for this file.

How can I find out more on what is causing the problem with this file?

Sham.

Ps. I have opened other files is the same directory and have not had any
problems.

That's strange. Make sure that the ASPNET user has read (or read-write)
access to this file. To do this, use the Security dialog in Windows
Explorer (right-click on the file and choose from the context menu).

I had cases in the past where corrupt MPG files would be almost impossible
to delete even after a reboot. Maybe the file is just invalid. Can you
play it in, say, Windows Media Player?

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top