Field
Aspects of the present invention generally relate to an image processing apparatus capable of transmitting image data, a method for controlling the image processing apparatus, and a storage medium. 
Description of the Related Art
Conventionally, it is known that a file which contains image data is sent from an image processing apparatus such as a multifunction peripheral (MFP).  As a sending protocol for file transmission, for example, Japanese Patent Application Laid-Open No.  2011-234126 discusses a technique for transmitting image data using a server message block (SMB).  Further, as another example, it is known that image data is transmitted using a distributed authoring and versioning protocol for the WWW (WebDAV).  As yet another example, it is known that image data is sent using a file transfer protocol (FTP). 
In case of performing such file transmission, path information indicating a host name of a file server that manages a folder, which becomes a storage destination of the image data, and a position of the folder, and authentication information (a user name and a password) for accessing the file server are necessary. 
When an image data file is sent from the image processing apparatus, a user, who operates the image processing apparatus, may want to send and store the image data to own folder as a destination.  In that case, there is a problem that it takes time and labor for the user to enter path information of the own folder. 
To deal with this problem, it is possible to automatically set path information of the folder for individual user, using a user ID which the user has entered when logging in to the image processing apparatus.  Accordingly, the user is freed from time and effort to enter path information of the own folder for each sending, or to select the path information of the own folder from many pieces of path information registered on an address book. 
In particular, if path information is generated in a manner that the user ID, which the user has entered, is added next to shared path, which is preset as common to a plurality of users, folders of respective users will be generated in a common layer within the file server.  This has an advantage that management becomes easy for an administrator. 
On the other hand, a domain controller (a domain server) is used in increasing frequency for logging in to the image processing apparatus.  The domain controller is a server that manages account information of a specific domain in an integrated fashion.  By using the domain controller, the necessity for managing account information for each apparatus is eliminated. 
In the domain controllers, a type of requiring addition of domain information at the head of the user ID to be used for authentication and a type of not requiring addition of domain information exist.  For example, in a case where user-unique information is “userx” and domain information is “Domainx”, when the former domain controller is used, “domainx¥userx” must be entered as the user ID.  When the latter domain controller is used, it is only necessary to enter “userx” as the user ID.  The symbol “¥” is a separator, which indicates that domain information comes ahead of the symbol, and user-unique information comes next to the symbol.  Separators of “@” and “\” (a back slash) other than “¥” are known. 
In this way, in an environment where a case of containing the domain information in the user ID and a case of not containing the domain information are mixed, inconvenience occurs when the user ID at the time of login is used as a portion of the path information of the folder.  The reason is that, when “domainx¥userx” is used as the user ID, the image data will be stored in a folder of one level deeper layer, as compared with a case where “userx” is used as the user ID.  When two types of domain controllers are used together in this way, the users' folders will be distributed in different layers, and management will become troublesome.  Further, there is also a possibility that the image data is stored in a folder of the user's unintended layer.