Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Security Exception: uploading excel file on server

Status
Not open for further replies.

theprowler

Programmer
Mar 25, 2005
29
IT
Hi everybody,
I've got a security exception performing an upload operation:

1. i want to store an excel file on my wpresources folder on server (and here is the problem)
2. i want to read some data on this excel file
3. i want to delete this file from server

I'm currently using WSS_Medium trust policy but it doesn't works...
Setting in web.config "trust=Full" all works so i guess i have to add a permission in my WSS_MediumTrust file...

Any ideas?

Thanks in advance!
 
I've noticed that the problem is not in saving file, but in reading data from excel through oledb...

Here's some code

'uploading file...
Try
selectedFile2.PostedFile.SaveAs(uploadPath)

Catch ex As Exception
lblErr.Text = "Error from importing excel file"
Exit Sub
End Try


'Connecting to excel file through oledb...
Dim excelConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data

Source=" & uploadPath & ";Extended Properties=""Excel 8.0;HDR=Yes""")
'open connection
excelConnection.Open()

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top