I am storing .dat files in ProgramData to write and read configurations about my software. I can read, but I can't write. These .dat files are copied when software is installed. The installer has been created with AwInstall.
CODE TO WRITE .DAT:
If File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) & "\NameSoftware\Configuration\paramsBiz.dat") = True Then
Dim sw As StreamWriter = New StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) & "\NameSoftware\Configuration\paramsBiz.dat")
sw.Write(myString)
sw.Close()
sw = Nothing
Return True
Else
Return False
End If
ERROR:
I am getting this error:
System.UnauthorizedAccessException: Acceso denegado a la ruta de acceso 'C:\ProgramData\NameSoftware\Configuration\paramsBiz.dat'.
en System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
en System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
en System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
en System.IO.StreamWriter.CreateFile(String path, Boolean append)
en System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
en System.IO.StreamWriter..ctor(String path)
UPDATE 1:
ok, is a problem with this directory ProgramData, as has been said Hans Passant
But alternative path could be used to store data and that any user (admin or not) can read and write these files?
Related
In my vb.net project, I want to save a ima in a folder, but I have this error:
System.UnauthorizedAccessException: Access to the path '\192.168.100.1\T-Dev\Docs\AGRFOB6NV0UM835B59MX34KT2.jpg' is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at P_ControlDoc46.Controllers.U_controldocController.UploadFile(HttpPostedFileBase postedFile, String descricao) in C:\Users\Pedro Moreira\Desktop\P_ControlDoc46\Controldoc-trimalhas\P_ControlDoc46\Controllers\U_controldocController.vb:line 146/DocsTeste/AGRFOB6NV0UM835B59MX34KT2.jpg
The code that I use to save the file is the following:
Try
'Save the Byte Array as Image File.
Dim filePath As String = Server.MapPath(String.Format(WebConfigurationManager.AppSettings("DocsFolder") + "{0}.jpg", fileName))
postedFile.SaveAs(filePath)
Catch ex As Exception
Console.WriteLine(ex)
Return RedirectToAction("IndexCreate", "U_controldoc")
End Try
Can someone help me?
Thanks
I have a problem, that VB.NET throws an error runtime with my custom fonts, but not always. Sometimes it works, sometimes not. here's my code:
Dim path As String
Private Sub MMenu_Load(sender As Object, e As EventArgs) Handles MyBase.Load
path = "C:/MMCTools/"
Try
Dim privateFonts As New System.Drawing.Text.PrivateFontCollection()
privateFonts.AddFontFile(path & "font.ttf")
Dim font20 As New System.Drawing.Font(privateFonts.Families(0), 20)
Dim font14 As New System.Drawing.Font(privateFonts.Families(0), 14)
Label1.Font = New Font(font20, FontStyle.Regular)
Label2.Font = New Font(font14, FontStyle.Regular)
Catch
MsgBox("Hiba")
End Try
If My.Computer.FileSystem.FileExists(path & "username.mcusr") Then
PictureBox1.ImageLocation = _
"http://mestermc.hu/3dskin/3d.php?a=0&w=0&wt=0&abg=0&abd=0&ajg=0&ajd=0&ratio=13format=png&displayHairs=true& headOnly=false&login=" _
& (ReadALine(path & "username.mcusr", GetNumberOfLines(path & "username.mcusr"), 0))
Else
MCUsr.Show()
Me.Close()
End If
End Sub
The error message:
************** Error contents **************
System.ArgumentException: Invalid parameter.
at: System.Drawing.FontFamily.GetName(Int32 language)
at: System.Drawing.FontFamily.get_Name()
at: System.Windows.Forms.Internal.WindowsFont.FromFont(Font font, WindowsFontQuality fontQuality)
at: System.Windows.Forms.Internal.WindowsGraphicsCacheManager.GetWindowsFont(Font font, WindowsFontQuality fontQuality)
at: System.Windows.Forms.TextRenderer.MeasureText(String text, Font font, Size proposedSize, TextFormatFlags flags)
at: System.Windows.Forms.Layout.LayoutUtils.MeasureTextCache.GetUnconstrainedSize (String text, Font font, TextFormatFlags flags)
at: System.Windows.Forms.Layout.LayoutUtils.MeasureTextCache.TextRequiresWordBrea k(String text, Font font, Size size, TextFormatFlags flags)
at: System.Windows.Forms.Label.CreateTextFormatFlags(Size constrainingSize)
at: System.Windows.Forms.Label.CreateTextFormatFlags()
at: System.Windows.Forms.Label.OnPaint(PaintEventArgs e)
at: System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at: System.Windows.Forms.Control.WmPaint(Message& m)
at: System.Windows.Forms.Control.WndProc(Message& m)
at: System.Windows.Forms.Label.WndProc(Message& m)
at: System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at: System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at: System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam
This happens when fast switching forms.
Just came across the error myself and figured it out. You are defining the private font collection in the load event and it goes out of scope thereby making it eligible for garbage collection. So depending on how fast it gets collected it may or may not still be around when needed.
I'll tell you how you do it. Don't actually import the fonts into your program but import it on to your computer.
Just access the:
Control Panel -> Appearance and Personalization -> Fonts
And drag the fonts into the folder. Next time, Visual Studio will load the font. This is for windows. If you are using another computer, search how to load fonts onto computer.
I've got your mistake here!!!! It's very easy to solve.
Path most be written with "\" not "/" that's all of it ^^
path = "C:\MMCTools\"
I'm trying to write an Outlook add-in in Visual Basic (in Visual Studio 2012 Professional on Windows 7) that will interface with a web service we use at work. Unfortunately this particular web service doesn't really stay with the times and as such, requires the Web Reference to implement Microsoft.Web.Services2.WebServicesClientProtocol to do certain things. When I change the generated Reference.vb to inherit this class instead of the default and Rebuild All, the build fails with the message:
------ Rebuild All started: Project: OutlookAddIn1, Configuration: Debug Any CPU ------
OutlookAddIn1 -> \\nas01\my-home$\chq-andrewt\Visual Studio 2012\Projects\OutlookAddIn1\OutlookAddIn1\bin\Debug\OutlookAddIn1.dll
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: The "FindRibbons" task failed unexpectedly.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'OutlookAddIn1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: File name: 'OutlookAddIn1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at System.Reflection.Assembly.Load(String assemblyString)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at System.UnitySerializationHolder.GetRealObject(StreamingContext context)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at Microsoft.Build.Framework.ITask.Execute()
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: === Pre-bind state information ===
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: DisplayName = OutlookAddIn1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: (Fully-specified)
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: Initial PrivatePath = NULL
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: Calling assembly : (Unknown).
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: ===
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: This bind starts in default load context.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: Using application configuration file: C:\Users\chq-andrewt\AppData\Local\Microsoft\VisualStudio\11.0\devenv.exe.config
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: Using host configuration file:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018: LOG: The same bind was seen before, and was failed with hr = 0x80070002.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(176,9): error MSB4018:
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I've found that the crash doesn't happen because of the change to Reference.vb specifically. I can consistently reproduce this if I create a new Outlook 2013 Add-In project, create a new class, and have it inherit Microsoft.Web.Services2.WebServicesClientProtocol:
Public Class Class1
Inherits Microsoft.Web.Services2.WebServicesClientProtocol
End Class
Once I make that change, I add Microsoft.Web.Services2.dll to the project References and after some prompting, System.Web.Services.dll. I rebuild all and promptly get the above error.
I've found that if I use Microsoft.Web.Services3.WebServicesClientProtocol instead, it works fine.
This is my first Visual Basic project (and any project using Microsoft tools, for that matter), so I may be missing something painfully obvious. The choice to use this web service (and WSE2 by extension) wasn't my choice; I'm trying to interface with something others have already purchased.
I've reinstalled Visual Studio with no luck.
Any hints on why this is happening or how to troubleshoot this a bit more? Thanks in advance!
It turns out that WSE 2 is simply too old. It only supports the .NET framework up to version 2, which is I think why it was tanking. I'm using 4.5 (could only go as low as 4) since I was writing an Outlook 2013 add-in. Since there isn't any built-in functionality for doing SOAP attachments AT ALL, I ended up POSTing the raw SOAP message by hand as it was a free solution and pretty straightforward.
No comment on how resilient and future-proof it is...
Public Shared Sub createAttachment(uploadPath As String, fileName As String, ticketHandle As String, description As String)
Dim fInfo As New FileInfo(uploadPath)
Dim numBytes As Long = fInfo.Length
Dim fStream As New FileStream(uploadPath, FileMode.Open, FileAccess.Read)
Dim br As New BinaryReader(fStream)
Dim data As Byte() = br.ReadBytes(CInt(numBytes))
br.Close()
fStream.Close()
Dim boundary As String = "Part_3_4083017.1413597427118"
' Set the 'Method' property of the 'Webrequest' to 'POST'.
Dim myHttpWebRequest As HttpWebRequest = CType(WebRequest.Create("http://soapserver:8080/axis/services/USD_R11_WebService"), HttpWebRequest)
myHttpWebRequest.Method = "POST"
myHttpWebRequest.UserAgent = "Jakarta Commons-HttpClient/3.1"
myHttpWebRequest.Host = "soapserver:8080"
myHttpWebRequest.ContentType = "multipart/related; type=""text/xml""; start=""<rootpart#soapui.org>""; boundary=""----=_" & boundary & """"
Dim myWebHeaderCollection As WebHeaderCollection = myHttpWebRequest.Headers
myWebHeaderCollection.Add("MIME-Version: 1.0")
myWebHeaderCollection.Add("Accept-Encoding: gzip,deflate")
myWebHeaderCollection.Add("SOAPAction:""""")
'myWebHeaderCollection.Add("Expect:100-continue")
Dim inputData As String = Console.ReadLine()
Dim postData As New StringBuilder()
postData.Append("------=_" & boundary & vbCrLf)
postData.Append("Content-Type: text/xml; charset=UTF-8" & vbCrLf)
postData.Append("Content-Transfer-Encoding: 8bit" & vbCrLf)
postData.Append("Content-ID: <rootpart#soapui.org>" & vbCrLf)
postData.Append("" & vbCrLf)
postData.Append("<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:ser=""http://www.vendorurl.com/TheirProduct"">")
postData.Append("<soapenv:Header/>")
postData.Append("<soapenv:Body>")
postData.Append("<ser:createAttachment>")
postData.Append("<sid>" & sid & "</sid>")
postData.Append("<repositoryHandle>" & getRepositoryHandle() & "</repositoryHandle>")
postData.Append("<objectHandle>" & ticketHandle & "</objectHandle>")
postData.Append("<description>" & description & "</description>")
postData.Append("<fileName>" & uploadPath & "</fileName>")
postData.Append("</ser:createAttachment>")
postData.Append("</soapenv:Body>")
postData.Append("</soapenv:Envelope>" & vbCrLf)
postData.Append("------=_" & boundary & vbCrLf)
postData.Append("Content-Type: image/x-png; name=" & fileName & vbCrLf)
postData.Append("Content-Transfer-Encoding: binary" & vbCrLf)
postData.Append("Content-ID: <" & fileName & ">" & vbCrLf)
postData.Append("Content-Disposition: attachment; name=""" & fileName & """; filename=""" & fileName & """" & vbCrLf)
postData.Append("" & vbCrLf)
Dim encoding As New UTF8Encoding()
Dim header As Byte() = encoding.GetBytes(postData.ToString)
Dim tail As Byte() = encoding.GetBytes(vbCrLf & "------=_" & boundary & "--")
myHttpWebRequest.ContentLength = header.Length + data.Length + tail.Length
Dim newStream As Stream = myHttpWebRequest.GetRequestStream()
newStream.Write(header, 0, header.Length)
newStream.Write(data, 0, data.Length)
newStream.Write(tail, 0, tail.Length)
newStream.Close()
Try
Dim response = myHttpWebRequest.GetResponse()
Dim s As Stream = response.GetResponseStream()
Dim sr As New StreamReader(s)
Dim Content As String = sr.ReadToEnd()
'Could parse Content to get the handler for our new attachment
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
I wrote a module to serialize a generic list into a binary file. If I wanted to allow multiple users to write to a file at the same time, or multiple users to read from the file at the same time, what do I need to do? I know there is a FileAccess enumeration I can pass to my filestream, but I am not sure what the limitations are, or what to set it as.
If FileAccess is for something else, what other solutions are there? (no databases)
Dim _Format As New BinaryFormatter
Public Function SavePack(Of T)(Filename As String, Output As T) As Boolean
SavePack(New FileStream(Filename, FileMode.Create), Output)
End Function
Public Function SavePack(Of T)(Stream As FileStream, Output As T) As Boolean
Dim Result As Boolean = False
Try
_Format.Serialize(Stream, Output)
Catch ex As Exception
Stream.Close()
End Try
Return Result
End Function
Has anyone delt with this exception from ABCpdf? We're running on Server 2008 and only have issues converting Office files (Word and Excel). This all worked well on Server 2003. Because we're only having issues with Office files I wonder if it's related to the XPS support on Server 2008? The code that calls into this function is running as a Windows Service.
Private Overloads Function ConvertMicrosoftOfficeDocToPdf(ByVal inputFile As Byte(), ByVal fileExt As String) As Byte()
Dim abcDoc As WebSupergoo.ABCpdf7.Doc = Nothing
Try
abcDoc = New WebSupergoo.ABCpdf7.Doc()
Dim xro As New WebSupergoo.ABCpdf7.XReadOptions()
xro.FileExtension = fileExt
Try
abcDoc.Read(inputFile, xro)
Catch ex As Exception
System.Diagnostics.Trace.Write(ex.ToString())
Throw ex
End Try
Dim fileBytes As Byte() = abcDoc.GetData()
Return fileBytes
Finally
If Not abcDoc Is Nothing Then
abcDoc.Clear()
abcDoc.Dispose()
End If
End Try
End Function
WebSupergoo.ABCpdf7.Internal.PDFException:
Attempted to read or write protected
memory. This is often an indication
that other memory is corrupt. --->
System.AccessViolationException:
Attempted to read or write protected
memory. This is often an indication
that other memory is corrupt.
at WebSupergoo.ABCpdf7.Internal.NDoc._InvokeMethod(IntPtr
inDoc, Int32 inMethod, Int32 inIndex,
Int32 inFlags, String inParams,
String& outErr)
at WebSupergoo.ABCpdf7.Internal.NDoc.InvokeMethod(IntPtr
inDoc, Int32 inMethod, Int32 inIndex,
Int32 inFlags, String inParams,
String& outErr)
at WebSupergoo.ABCpdf7.Doc.PrintToXps(String
inputFile, String outputFile, Int32
timeout, String printerName)
at WebSupergoo.ABCpdf7.Operations.XpsImportOperation.ImportAny(Doc
doc, String path, Int32 timeout)
at WebSupergoo.ABCpdf7.XReadOptions.ImportXpsAny(Doc
doc, String path, Boolean clear)
at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc
doc, Byte[] data, ReadModuleType
module)
at WebSupergoo.ABCpdf7.XReadOptions.Read(Doc
doc, Byte[] data)
Added a folder called "Desktop" here:
C:\Windows\SysWOW64\config\systemprofile\
http://social.msdn.microsoft.com/Forums/en/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91
Actual problem is that the folder where you are trying write the file, give the write permission to IIS_IUSR. Then it should work.