Normal Topic FTP() and @Insert() command help (Read 867 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
FTP() and @Insert() command help
Sep 24th, 2012 at 5:04pm
Print Post Print Post  
I am running a retrieve and report and then need to FTP that file. I have it working  when I am in single user on my Dev machine, however I need help understanding how to deal with the file on the server side when using @Insert()


The code below generates the file and in multi user it places the file on the server in C:\sesame but the @Insert() is looking for it on the client. so it does not get the data to send properly.

What is the proper method to deal with this?
My Mickey Mouse /  Rube Goldberg  thought was to create a batch file that copies or moves the file from the server to a shared drive and have @Insert() read it from there.

Thanks


Subroutine sendftptoMach()
var vFile as String
var vSource as String

vSource = @Insert("C:\sesame\OrderMonthDat.txt")

Ftp("www.placegoing.com", "username", "Password", "OrderMonthDat.txt" , Vsource)

     If @Error Then
     {
                 @Msgbox("The send failed", "", "friggin try something else")


     }


End subroutine


Var VStr as string
var vRun as Int

// Loads an already saved retrieve spec for use
vStr = @SpecCommand(SPEC_OPERATION_LOAD, SPEC_TYPE_RETRIEVE, "OrdersMonth")
// Runs the currently loaded retrieve spec
vStr = @SpecCommand(SPEC_OPERATION_RUN, SPEC_TYPE_RETRIEVE, "")

// Loads an already saved sort spec for use
//vStr = @SpecCommand(SPEC_OPERATION_LOAD, SPEC_TYPE_SORT, "RepStatRef")
// Runs the currently loaded sort spec
//vStr = @SpecCommand(SPEC_OPERATION_RUN, SPEC_TYPE_SORT, "")


     If @Mode() = 1
     {
           vRun = @LoadExportSpec("webexp1")
           If vRun = 1
           {
                 
           RunExportSpec("c:\Sesame\OrderMonthDat.txt",",","",0,1,0,1,0,1,0,0)

           // Clears the current retrieve spec
           vStr = @SpecCommand(SPEC_OPERATION_CLEAR, SPEC_TYPE_RETRIEVE, "")
           
           // Run subroutine to FTP data to a file on web server
           sendftptoMach ()
           
           }
     }
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: FTP() and @Insert() command help
Reply #1 - Sep 25th, 2012 at 12:38am
Print Post Print Post  
So I am thinking that if I map a network drive to the machine Sesame server is on that is shared with the same drive letter by my users and change the c:\ to s:\ in the line below and then have @insert read from S:\Sesame all should work .


From this:

RunExportSpec("c:\Sesame\OrderMonthDat.txt",",","",0,1,0,1,0,1,0,0)

To this

RunExportSpec("S:\Sesame\OrderMonthDat.txt",",","",0,1,0,1,0,1,0,0)

And From this:

vSource = @Insert("C:\sesame\OrderMonthDat.txt")

To this:

vSource = @Insert("S:\sesame\OrderMonthDat.txt")

Am I breaking any cardinal rules doing this this way?

Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: FTP() and @Insert() command help
Reply #2 - Sep 25th, 2012 at 12:36pm
Print Post Print Post  
Probably fine.

I prefer the use of UNC paths instead. Hopefully, someday, MS will implement "drive mounting", where any filesystem can be mounted as a directory. But, until then, the UNC path is about as close as you can get.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: FTP() and @Insert() command help
Reply #3 - Sep 25th, 2012 at 3:43pm
Print Post Print Post  
If you do go mapped drives you'll want this line to stay the same as it's passing the path to the server so it's the server's C drive which is the client's S drive.

Code
Select All
RunExportSpec("c:\Sesame\OrderMonthDat.txt",",","",0,1,0,1,0,1,0,0) 



Another option is to write the export file out locally. All you would have to do is just copy and paste some code out of any old wordmerge routine and change the elements it's writing out and where it's writing them to.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: FTP() and @Insert() command help
Reply #4 - Sep 25th, 2012 at 4:09pm
Print Post Print Post  
BOBSCOTT wrote on Sep 24th, 2012 at 5:04pm:
@Msgbox("The send failed", "", "friggin try something else")


I got a good chuckle when I came across that line. I guess I just didn't expect something funny in a line of code, but that just got me laughing out loud. In my head I heard it in the voice of Napoleon Dynamite.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: FTP() and @Insert() command help
Reply #5 - Sep 25th, 2012 at 8:26pm
Print Post Print Post  
Thanks everyone for the help! It is greatly appreciated.

Ray the Reaper wrote on Sep 25th, 2012 at 3:43pm:
If you do go mapped drives you'll want this line to stay the same as it's passing the path to the server so it's the server's C drive which is the client's S drive.

Code
Select All
RunExportSpec("c:\Sesame\OrderMonthDat.txt",",","",0,1,0,1,0,1,0,0) 



-Ray


Ray,

Thanks for the help I always appreciate it. Rather than sharing the drive that is in the same machine as Sesame Server is running on I share a drive on another machine as S:\sesame and then have the sesame server machine write out my files used for ftp and shared stuff to it by having that machine have it as a mapped S:\ drive also. this way no one is messing around with stuff on the Sesame server machine other than what sesame client does on that server.

It may not really make a difference but in my mind it seems a bit safer. The Sesame server writes a file to it once and then the client machines can access it all they want without putting a burden  on the sesame server. It also keeps anyone from doing something stupid like putting a huge file or infected file on the machine Sesame runs on by mistakenly doing something with the shared drive.


Carl Underwood wrote on Sep 25th, 2012 at 4:09pm:
BOBSCOTT wrote on Sep 24th, 2012 at 5:04pm:
@Msgbox("The send failed", "", "friggin try something else")


I got a good chuckle when I came across that line. I guess I just didn't expect something funny in a line of code, but that just got me laughing out loud. In my head I heard it in the voice of Napoleon Dynamite.


Carl,

I was secretly happy it was my words that made you laugh and not my code.

I figure the Lanticans must get a great laugh sometimes seeing how I kluge things together. 

  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: FTP() and @Insert() command help
Reply #6 - Sep 25th, 2012 at 8:59pm
Print Post Print Post  
BOBSCOTT wrote on Sep 25th, 2012 at 8:26pm:
Thanks for the help I always appreciate it. Rather than sharing the drive that is in the same machine as Sesame Server is running on I share a drive on another machine as S:\sesame and then have the sesame server machine write out my files used for ftp and shared stuff to it by having that machine have it as a mapped S:\ drive also. this way no one is messing around with stuff on the Sesame server machine other than what sesame client does on that server.

It may not really make a difference but in my mind it seems a bit safer. The Sesame server writes a file to it once and then the client machines can access it all they want without putting a burden  on the sesame server. It also keeps anyone from doing something stupid like putting a huge file or infected file on the machine Sesame runs on by mistakenly doing something with the shared drive.


Gotcha, and it makes perfect sense. I've just seen too many setups where an IT guy created a mapped drive on the server that pointed back to the server and wondered why it was slow and didn't want you to go down that path.

BOBSCOTT wrote on Sep 25th, 2012 at 8:26pm:
I figure the Lanticans must get a great laugh sometimes seeing how I kluge things together. 


Nah, the only time I laugh at you is when you tell me you're gonna send me Zappa music...

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged