?
Solved

Write to Samba Share in ASP.Net VB

Posted on 2009-05-07
5
Medium Priority
?
975 Views
Last Modified: 2013-12-02
I have setup a new Samba Share on our internal network, pointing to a folder on our SCO Unix server. On my XP Pro development PC, file system version of my WebSite, I am able to write to this Share folder no problem. But once I install it on our Windows 2003 server using IIS6 I get an error when trying to create the text file on the Share folder, see below.

What do I need to do to be able to write to this Samba folder from the Windows 2003 server Web Site? I created a virtual directory pointing to the Samba share folder, how to I reference it in my VB code behind. I have tried ApplicationPath, PhysicalApplicationPath etc... none work.

Also, I am able to browse and write to the Sahre folder from our Windows 2003 server using Explorer, no user name or password required. I suspect it has something to do with IIS6...
Ecception Details: System.IO.IOException: Logon failure: unknown user name or bad password.
 
Line 164: owriter=IO.File.CreateText("\\Encore\WebOrderFiles\W" & mlngIdentity.ToString("00000000") & ".dat")
 
*** \\Encore\WebOrderFiles is the Samba Share folder name.

Open in new window

0
Comment
Question by:michouis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 12

Accepted Solution

by:
GuitarRich earned 1000 total points
ID: 24331155
Start by making sure the Network Service and the IUSR anonymous IIS users have write access to that folder.
0
 

Author Comment

by:michouis
ID: 24335429
Ok. When I try adding a new user in Samba, username = IUSR_RM0045, 1st it complains that the user account must exist in Unix. But this username is not legal in Unix, must be a max. of 8 characters, so I cannot create the account on the Unix server. I tried changing the user in Directory Security to ASPNET and then created a Unix account called aspnet (lowercase enforced by Unix, what can I do?), then created a Samba user called aspnet successfully but I am still getting the error. When i choose the FIND usernames option in Directory Security for Annonymous login it only shows me a set list of users including RM0045\IUSR_RM0045, IUSR_RM0045, ASPNET etc... am I in the right place?
Sorry for my ignorance in this user security issue, and thanks for helping.
0
 

Author Comment

by:michouis
ID: 24337181
ok, now I tried mapping a network drive (s:) to the Samba shared folder. I am able to open the s: drive and see the contents of the Samba share folder. Yet when I change my syntax to create the file on "s:\" I still get an error that part of the path could not be found.

Then I created a folder under the c: drive and changed the create file syntax to point to "c:\newfolder" and it worked fine, the files were created. What a royal pain!

Why can't I access the mapped network drive s:? What does it mean by "cannot find part of the path"? Why? I spend about 1 year writing a complete e-commerce Web Site and then another week (so far) trying to implement it. It should not be so compliacted (but I guess it just is).

Has no one else in the world ever had to do this, create a text file on a Samba shared foldder from an ASP.Net application running on Windows 2003 under IIS6? Hard to believe. Please help.
0
 

Author Comment

by:michouis
ID: 24339166
I guess I have stumpped the whole community??
0
 

Author Closing Comment

by:michouis
ID: 31579233
I have resolved this with help through my other question. I setup a domain user and made sure it has access to both SQL server and Samba...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction People like FTP.  It's a solid, stable, robust protocol for quickly transferring files between two hosts using TCP/IP.  In most cases it's much faster than SMB or CIFS, and certainly much easier to set up between organizations.  This…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question