Mappath and FileStream in external class doesn not work correctly on server
<p>This is my code that is written in a class in a sub-folder of a main directory:</p>

<pre><code>string c = global.RandomCode(32) + "." + ext;
using (FileStream fs = new FileStream(HttpContext.Current.Server.MapPath(@"..\adimgs\"+c),FileMode.CreateNew,FileAccess.Write))
{
    byte[] a = Convert.FromBase64String(img);
    fs.Write(a, 0, a.Length);
}
</code></pre>

<p>this works great in localhost but not in server side. as I use jquery and a page with lots of posted data calls the function in this class I don't see an error to identify the problem.</p>

<p>I wrote a code that saves HttpContext.Current.Server.MapPath(@"..\adimgs\"+c) in the database and the result was as expected. there must be something wrong with filestream (that works in localhost), some access authorization problem may be. Can anyone tell me what is the problem with this code? </p>
