Alpha Video Training
Results 1 to 4 of 4

Thread: Desktop App Running on IIS & How To Access Network Shares

  1. #1
    Member
    Real Name
    Tiran Irani
    Join Date
    Jan 2014
    Location
    Bundaberg, Australia
    Posts
    21

    Default Desktop App Running on IIS & How To Access Network Shares

    I have a desktop application running on an Alpha IIS server and would like to perform file operations using XBasic code on a network share within the same Windows domain. Simple things like create a file, delete a file, read a files contents.

    I've tested some simple XBasic code using 'save_to_file' function which works when I run the app in live preview mode to a local folder but when I change it to a UNC path to a network server, no file is created and no errors are reported.

    Can anyone explain how this can be achieved? Are there some specific security configuration requirements in IIS or can it all be done from within the application?

    Thanks in advance.

  2. #2
    "Certified" Alphaholic TheSmitchell's Avatar
    Real Name
    Sarah
    Join Date
    Apr 2012
    Posts
    1,333

    Default Re: Desktop App Running on IIS & How To Access Network Shares

    Quote Originally Posted by tirani View Post
    I have a desktop application running on an Alpha IIS server and would like to perform file operations using XBasic code on a network share within the same Windows domain. Simple things like create a file, delete a file, read a files contents.

    I've tested some simple XBasic code using 'save_to_file' function which works when I run the app in live preview mode to a local folder but when I change it to a UNC path to a network server, no file is created and no errors are reported.

    Can anyone explain how this can be achieved? Are there some specific security configuration requirements in IIS or can it all be done from within the application?

    Thanks in advance.
    Storage connections were created for working with files under IIS and Alpha Cloud. Bonus: they work in the Developer IDE and classic server, too.

    Take a look: https://documentation.alphasoftware....tion%20strings
    Alpha Anywhere latest pre-release

  3. #3
    Member
    Real Name
    Tiran Irani
    Join Date
    Jan 2014
    Location
    Bundaberg, Australia
    Posts
    21

    Default Re: Desktop App Running on IIS & How To Access Network Shares

    Excellent, looks like what I need.
    I don't develop with Alpha a huge amount & haven't delved in to all its functionality so it's nice find out about these little things that make life easier!

    Thanks very much!

  4. #4
    Member
    Real Name
    Tiran Irani
    Join Date
    Jan 2014
    Location
    Bundaberg, Australia
    Posts
    21

    Default Re: Desktop App Running on IIS & How To Access Network Shares

    So, I have this working when using live preview or when the app is published to the local webroot. But, when I publish & run the app on IIS I'm getting an access denied error.

    I'm using the a5storage_savedata() function in XBasic and have created an appropriate storage connection string with username/password that connects to the server share (\\********\VClient) successfully (I've replaced the server name with ********). The function I've created is:

    Code:
    function CreateRemoteFlagFile as c (mode as c)
    debug(1)
    
    	dim pResult as p
    	dim bMode as b	
    	dim returnFlag as l
    	
    	bMode = char_to_blob(mode)
    
    	returnFlag = a5storage_savedata("::storage::VanguardClient",bMode,mode,"",pResult)
    	if returnFlag = .F. then
    		if pResult.hasError = .T. then
    			CreateRemoteFlagFile = pResult.errorText
    			exit function
    		end if
    	end if
    	
    	CreateRemoteFlagFile = ""
    
    end function
    where bMode is the blob data (a string converted using char_to_blob) and mode is the filename - IMPORTFLAG.

    The value being returned in pResult.errorText is as follows.

    Item was not saved. Error reported was:
    Access to the path \x27\\********\VClient\IMPORTFLAG\x27 is denied.
    I know security issues can be difficult to diagnose, but is there anything in either the app or IIS I can use to figure out why this is failing when running on IIS?

    Thanks

Similar Threads

  1. Aliases - Confussed...Creation...Shares
    By cavj1 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 11-06-2009, 11:47 AM
  2. Running database over network ?
    By secondcircuits in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 09-26-2008, 11:00 AM
  3. Alpha Four - running different versions on a network
    By gunper in forum Alpha Four Versions 7 and 8
    Replies: 1
    Last Post: 03-17-2008, 08:32 PM
  4. Network Running very slow
    By Ronald Anusiewicz in forum Alpha Five Version 8
    Replies: 20
    Last Post: 04-19-2007, 03:30 PM
  5. Running Across Network
    By davej in forum Alpha Five Version 5
    Replies: 6
    Last Post: 04-29-2005, 03:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •