By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,506 Members | 1,876 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,506 IT Pros & Developers. It's quick & easy.

How to bulk insert because file 'C:\Inetpub\wwwroot\Webfile1\Data\upload.txt' ....

100+
P: 347
I have a web page written in asp.net that is basically an upload button that does a bulk insert into a sql table.

When a user presses an upload button, a .txt file is uploaded to a directory on the web server, and also inserted into a sql server on my network. I can get the file to upload to the correct destination but when the server tries to bulk insert to the database I get the following error:

Could not bulk insert because file 'C:\Inetpub\wwwroot\Webfile1\Data\upload.txt' could not be opened. Operating system error code 3

I have attempted to use UNC for the path for the file, but as the file is being uploaded in the first place, that doesnt seem like the problem. I also modified the machine.config on the web server to have the asp.net instance log in as the administrator on the web server, the permissions of the Data directory is set to everyone to have admin rights to that folder. On the sql server, bulk administer permissions are enabled and there are no contraints for triggers or keeping identity. Can anyone please help me understand why this isnt working?

Thank you,

Doug
May 14 '10 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
The file is on your client side. Search for some free script on how to upload file to an ftp server and subsequently upload it to your SQL Server.

Happy Coding!!!

~~ CK
May 17 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.