Upload File
-
i am doing this for uploding the file in the specified directory. But it gives error after the line which i have bolded. Dim SavePath As String = "C:\temp\" If IsNothing(filMyFile.PostedFile) = False Then Try Dim PostedFile = filMyFile.PostedFile Dim FileName As String = PostedFile.FileName Dim ContentType As String = PostedFile.ContentType Dim ContentLength As Integer = PostedFile.ContentLength PostedFile.SaveAs(SavePath & FileName) Message.Text = PostedFile.FileName & "Uploaded" & _ "
Content Type: " & ContentType & _ "
Content Length: " & ContentLength.ToString Catch ex As Exception Message.Text = "Failed To upload File" & ex.Source & ex.Message End Try End If Error msg : mscorlib Exception has been thrown by the target of an envocation. can someone please help me out. Thanks in advanceMohinder Singh
-
i am doing this for uploding the file in the specified directory. But it gives error after the line which i have bolded. Dim SavePath As String = "C:\temp\" If IsNothing(filMyFile.PostedFile) = False Then Try Dim PostedFile = filMyFile.PostedFile Dim FileName As String = PostedFile.FileName Dim ContentType As String = PostedFile.ContentType Dim ContentLength As Integer = PostedFile.ContentLength PostedFile.SaveAs(SavePath & FileName) Message.Text = PostedFile.FileName & "Uploaded" & _ "
Content Type: " & ContentType & _ "
Content Length: " & ContentLength.ToString Catch ex As Exception Message.Text = "Failed To upload File" & ex.Source & ex.Message End Try End If Error msg : mscorlib Exception has been thrown by the target of an envocation. can someone please help me out. Thanks in advanceMohinder Singh
-
i am doing this for uploding the file in the specified directory. But it gives error after the line which i have bolded. Dim SavePath As String = "C:\temp\" If IsNothing(filMyFile.PostedFile) = False Then Try Dim PostedFile = filMyFile.PostedFile Dim FileName As String = PostedFile.FileName Dim ContentType As String = PostedFile.ContentType Dim ContentLength As Integer = PostedFile.ContentLength PostedFile.SaveAs(SavePath & FileName) Message.Text = PostedFile.FileName & "Uploaded" & _ "
Content Type: " & ContentType & _ "
Content Length: " & ContentLength.ToString Catch ex As Exception Message.Text = "Failed To upload File" & ex.Source & ex.Message End Try End If Error msg : mscorlib Exception has been thrown by the target of an envocation. can someone please help me out. Thanks in advanceMohinder Singh
I think, you don't have the permission to save the file to the specified location ("C:\temp\"). Set write permission to IUSR_YOURMACHINENAME user to that folder. If you still have the same problem, post the complete StackTrace information. The Error Message you posted is not sufficient to debug the Error.
Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group
-
I think, you don't have the permission to save the file to the specified location ("C:\temp\"). Set write permission to IUSR_YOURMACHINENAME user to that folder. If you still have the same problem, post the complete StackTrace information. The Error Message you posted is not sufficient to debug the Error.
Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group
Complete stacktrace information: at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess) at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean verifyAccess) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Microsoft.VisualBasic.CompilerServices.LateBinding.FastCall(Object o, MethodBase method, ParameterInfo[] Parameters, Object[] args, Type objType, IReflect objIReflect) at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn) at Microsoft.VisualBasic.CompilerServices.LateBinding.LateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack) at WebsiteLogix.Personal_Resource.Upload_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebsiteLogix\Personal Resource.aspx.vb:line 70
Mohinder Singh
-
I think, you don't have the permission to save the file to the specified location ("C:\temp\"). Set write permission to IUSR_YOURMACHINENAME user to that folder. If you still have the same problem, post the complete StackTrace information. The Error Message you posted is not sufficient to debug the Error.
Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group
inner exception: System.NotSupportedException: The given path's format is not supported. at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) at System.Security.Util.StringExpressionSet.AddExpressions(String[] str, Boolean checkForDuplicates, Boolean needFullPath) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename)
Mohinder Singh
-
I think, you don't have the permission to save the file to the specified location ("C:\temp\"). Set write permission to IUSR_YOURMACHINENAME user to that folder. If you still have the same problem, post the complete StackTrace information. The Error Message you posted is not sufficient to debug the Error.
Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group