Quantcast
Channel: West Wind Message Board Messages
Viewing all 10393 articles
Browse latest View live

Re: Container and Lines objects

$
0
0
Re: Container and Lines objects
FoxInCloud
Re: Container and Lines objects
Feb. 2, 2013
07:52 am
3PG0GVA1XShow this entire thread in new window
These ae the screenshots. The first in Lan mode (and the same is in the debug)

and the second is on iPad

I have no code to post because this form and the container in it are all inserted in form in design non with code

All the lines are not visible, in every style (sunken, plan, raised)


please post code and screenshot, hard to find without these ...
thanks


I downloaded the new version, but nothing has changed....do i need to do something particular ???????


We fixed that recently
Please download a current install from our server using the link on your notification email


I have inserted in one form some container class and line class, but when i show this form in browser i can't see the border and the lines as i defined in the form....





New problem with containers

$
0
0
New problem with containers
FoxInCloud
New problem with containers
Feb. 2, 2013
08:43 am
3PG0IOQY6Show this entire thread in new window
Gratar Image based on email address
From:Michele
To:thn@foxincloud.com
I have a form with some containers in it. With a button i add runtime some objects in one of thiese container, in the first.
The code to add this object is

ThisForm.D1.clearApps ThisForm.D1.AddObject("A1","_appointment")With ThisForm.D1.A1 .Height = 200 .Tag = "APP" .Top = 250 .Left = 1 ._Label1.Caption = "Demo COGEN" .Visible = .T.EndWith ThisForm.D1.wlContentChanged = .T. ThisForm.Refresh

Where clearApp is a method that clean all the objects already contained in D1 that is the container

When i open the form the first time it appears as in this image

after i click the button to add objects it changes, but the object is not added where i ask (the object has top=250 while in the form it seems at 0 and also the height is not correct. Iy has the properties i defined in the object class)

If i close the form (with the button we found in awcmdok) and the i open the form again i see the form without object in the container (even if in the debug it has still the object)

and when i add newly the object with my button (as i do the first time) the object is added in the correct position

What do i need to do to add the object without problems. This form must show user's appointment in week view....

Thanks

POSTing XML in HTTP Request?

$
0
0
POSTing XML in HTTP Request?
West Wind Internet Protocols
POSTing XML in HTTP Request?
Feb. 2, 2013
09:52 am
3PG0L61J7Show this entire thread in new window
Gratar Image based on email address
From:SteveP
To:All
Hi All,
I need to submit an XML string to a vendor's website. I need to confirm I am doing this correctly.

Here's what I am doing:

1) Create Object using wwIPStuff > Success
2) Connect to server using HTTPConnect() > Success
3) Build XML String > XML Validator indicates No errors when I validate the string
4) Issue lcXML = STRCONV(lcXML, 9)
5) Set Headers to include: Content-Type: text/xml
6) Issue AddPostKey() to clear POST Buffer
7) Set nHttpPostMode = 4
8) Issue AddPostKey(lcXML)
9) Issue HTTPGetEx(lcPage,@lcResponse,@lnSize,lcHeaders) > Error 500.00 Internal Server Error

The vendor says the problem is either bad XML or invalid content type header.
The vendor also says the XML String should be posted as body of http request.

Question: Does AddPostKey(lcXML) place the XML string into the body of the http request?
If not, how would I place the XML string into the body of the http request?

Finally, once I get this working correctly, the vendor will send a zipped file in the response. The file size will be approximately 6Meg. Am I using the correct approach with HTTPGetEx shown above? Ultimately, I need to save the zipped file to disk for further processing.

Thanks!

TIA,
Steve

Re: POSTing XML in HTTP Request?

$
0
0
Re: POSTing XML in HTTP Request?
West Wind Internet Protocols
Re: POSTing XML in HTTP Request?
Feb. 2, 2013
09:57 am
3PG0LC3IOShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:SteveP
Steve,

This is much simpler:

lcXML = "<XML FROM WHEREEVER>" loHttp = CREATEOBJECT("wwHttp") loHttp.nHttpPostMode = 4 loHttp.AddPostKey(lcXML) lcResult = loHttp.HttpGet(lcUrl) ? lcResult

+++ Rick ---


Hi All,
I need to submit an XML string to a vendor's website. I need to confirm I am doing this correctly.

Here's what I am doing:

1) Create Object using wwIPStuff > Success
2) Connect to server using HTTPConnect() > Success
3) Build XML String > XML Validator indicates No errors when I validate the string
4) Issue lcXML = STRCONV(lcXML, 9)
5) Set Headers to include: Content-Type: text/xml
6) Issue AddPostKey() to clear POST Buffer
7) Set nHttpPostMode = 4
8) Issue AddPostKey(lcXML)
9) Issue HTTPGetEx(lcPage,@lcResponse,@lnSize,lcHeaders) > Error 500.00 Internal Server Error

The vendor says the problem is either bad XML or invalid content type header.
The vendor also says the XML String should be posted as body of http request.

Question: Does AddPostKey(lcXML) place the XML string into the body of the http request?
If not, how would I place the XML string into the body of the http request?

Finally, once I get this working correctly, the vendor will send a zipped file in the response. The file size will be approximately 6Meg. Am I using the correct approach with HTTPGetEx shown above? Ultimately, I need to save the zipped file to disk for further processing.

Thanks!



Rick Strahl
West Wind Technologies


from Lago de Garda, Italy

Making waves on the Web

Re: POSTing XML in HTTP Request?

$
0
0
Re: POSTing XML in HTTP Request?
West Wind Internet Protocols
Re: POSTing XML in HTTP Request?
Feb. 2, 2013
10:18 am
3PG0M3I8JShow this entire thread in new window
Gratar Image based on email address
From:SteveP
To:Rick Strahl
Hi Rick,
Yes, I saw where HTTPGet is easier, and I may end up using it as I get further down the road.
I also re-looked at the lcOutputFile option and probably need to use that to capture the zip file.
It also appears that AddPostKey(lcXML) does add the XML file after the headers, essentially as body, right?

This is a new service on the vendor's webserver, so the issue may be on their end. We are in test mode.

Thanks for the feedback! Hope it's warmer where you are then Kentucky!


Steve,

This is much simpler:

lcXML = "<XML FROM WHEREEVER>" loHttp = CREATEOBJECT("wwHttp") loHttp.nHttpPostMode = 4 loHttp.AddPostKey(lcXML) lcResult = loHttp.HttpGet(lcUrl) ? lcResult

+++ Rick ---


Hi All,
I need to submit an XML string to a vendor's website. I need to confirm I am doing this correctly.

Here's what I am doing:

1) Create Object using wwIPStuff > Success
2) Connect to server using HTTPConnect() > Success
3) Build XML String > XML Validator indicates No errors when I validate the string
4) Issue lcXML = STRCONV(lcXML, 9)
5) Set Headers to include: Content-Type: text/xml
6) Issue AddPostKey() to clear POST Buffer
7) Set nHttpPostMode = 4
8) Issue AddPostKey(lcXML)
9) Issue HTTPGetEx(lcPage,@lcResponse,@lnSize,lcHeaders) > Error 500.00 Internal Server Error

The vendor says the problem is either bad XML or invalid content type header.
The vendor also says the XML String should be posted as body of http request.

Question: Does AddPostKey(lcXML) place the XML string into the body of the http request?
If not, how would I place the XML string into the body of the http request?

Finally, once I get this working correctly, the vendor will send a zipped file in the response. The file size will be approximately 6Meg. Am I using the correct approach with HTTPGetEx shown above? Ultimately, I need to save the zipped file to disk for further processing.

Thanks!




TIA,
Steve

Detecting disabled cookies

$
0
0
Detecting disabled cookies
Web Connection 5.0
Detecting disabled cookies
Feb. 2, 2013
10:20 am
3PG0M5FFBShow this entire thread in new window
Gratar Image based on email address
From:Joel Aiken
To:All
What's the best way to detect that a visitor to my website has cookies disabled?
I want to identify such visitors and then alert them that they cannot shop without enabling their cookies.

Joel

Re: POSTing XML in HTTP Request?

$
0
0
Re: POSTing XML in HTTP Request?
West Wind Internet Protocols
Re: POSTing XML in HTTP Request?
Feb. 2, 2013
10:58 am
3PG0NJ82TShow this entire thread in new window
Gratar Image based on email address
From:SteveP
To:Rick Strahl
Is there any way to see exactly what is being sent by HTTPGetEx()?
Do I need Fiddler for this?



Steve,

This is much simpler:

lcXML = "<XML FROM WHEREEVER>" loHttp = CREATEOBJECT("wwHttp") loHttp.nHttpPostMode = 4 loHttp.AddPostKey(lcXML) lcResult = loHttp.HttpGet(lcUrl) ? lcResult

+++ Rick ---


Hi All,
I need to submit an XML string to a vendor's website. I need to confirm I am doing this correctly.

Here's what I am doing:

1) Create Object using wwIPStuff > Success
2) Connect to server using HTTPConnect() > Success
3) Build XML String > XML Validator indicates No errors when I validate the string
4) Issue lcXML = STRCONV(lcXML, 9)
5) Set Headers to include: Content-Type: text/xml
6) Issue AddPostKey() to clear POST Buffer
7) Set nHttpPostMode = 4
8) Issue AddPostKey(lcXML)
9) Issue HTTPGetEx(lcPage,@lcResponse,@lnSize,lcHeaders) > Error 500.00 Internal Server Error

The vendor says the problem is either bad XML or invalid content type header.
The vendor also says the XML String should be posted as body of http request.

Question: Does AddPostKey(lcXML) place the XML string into the body of the http request?
If not, how would I place the XML string into the body of the http request?

Finally, once I get this working correctly, the vendor will send a zipped file in the response. The file size will be approximately 6Meg. Am I using the correct approach with HTTPGetEx shown above? Ultimately, I need to save the zipped file to disk for further processing.

Thanks!




TIA,
Steve

Success!

$
0
0
Success!
Web Connection 5.0
Success!
Feb. 2, 2013
02:04 pm
3PG0U5SB5Show this entire thread in new window
Gratar Image based on email address
From:MB
To:All
Hi Rick - just thought I would mention to you and the community that I have been using WWWC since 1999 at my company. As a long time user I have not used any of the installation tools now provided. My dev environment is running on a mac using parallels desktop. I installed the trial version of 2008 server r2, then installed the iis6 legacy stuff and ran your setup.exe. The whole thing took maybe an hour from a brand new install of 2008, vfp, and wconnect.

Worked flawlessly.


Re: Success!

$
0
0
Re: Success!
Web Connection 5.0
Re: Success!
Feb. 2, 2013
03:43 pm
3PG0XOUTGShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:MB
Thanks for the feedback Michael. But... that's the way it's supposed to work :-)

+++ Rick ---



Hi Rick - just thought I would mention to you and the community that I have been using WWWC since 1999 at my company. As a long time user I have not used any of the installation tools now provided. My dev environment is running on a mac using parallels desktop. I installed the trial version of 2008 server r2, then installed the iis6 legacy stuff and ran your setup.exe. The whole thing took maybe an hour from a brand new install of 2008, vfp, and wconnect.

Worked flawlessly.



Rick Strahl
West Wind Technologies


from Lago de Garda, Italy

Making waves on the Web

Re: POSTing XML in HTTP Request?

$
0
0
Re: POSTing XML in HTTP Request?
West Wind Internet Protocols
Re: POSTing XML in HTTP Request?
Feb. 2, 2013
03:43 pm
3PG0XOUT6Show this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:SteveP

You should always use HttpGet() not HttpGetEx(). There is no longer a reason to use the lower level function since it's called by HttpGet() which provides all the same options and features, with much less code...

You can trace any HTTP request with Fiddler, yes...

+++ Rick ---



Hi Rick,
Yes, I saw where HTTPGet is easier, and I may end up using it as I get further down the road.
I also re-looked at the lcOutputFile option and probably need to use that to capture the zip file.
It also appears that AddPostKey(lcXML) does add the XML file after the headers, essentially as body, right?

This is a new service on the vendor's webserver, so the issue may be on their end. We are in test mode.

Thanks for the feedback! Hope it's warmer where you are then Kentucky!


Steve,

This is much simpler:

lcXML = "<XML FROM WHEREEVER>" loHttp = CREATEOBJECT("wwHttp") loHttp.nHttpPostMode = 4 loHttp.AddPostKey(lcXML) lcResult = loHttp.HttpGet(lcUrl) ? lcResult

+++ Rick ---


Hi All,
I need to submit an XML string to a vendor's website. I need to confirm I am doing this correctly.

Here's what I am doing:

1) Create Object using wwIPStuff > Success
2) Connect to server using HTTPConnect() > Success
3) Build XML String > XML Validator indicates No errors when I validate the string
4) Issue lcXML = STRCONV(lcXML, 9)
5) Set Headers to include: Content-Type: text/xml
6) Issue AddPostKey() to clear POST Buffer
7) Set nHttpPostMode = 4
8) Issue AddPostKey(lcXML)
9) Issue HTTPGetEx(lcPage,@lcResponse,@lnSize,lcHeaders) > Error 500.00 Internal Server Error

The vendor says the problem is either bad XML or invalid content type header.
The vendor also says the XML String should be posted as body of http request.

Question: Does AddPostKey(lcXML) place the XML string into the body of the http request?
If not, how would I place the XML string into the body of the http request?

Finally, once I get this working correctly, the vendor will send a zipped file in the response. The file size will be approximately 6Meg. Am I using the correct approach with HTTPGetEx shown above? Ultimately, I need to save the zipped file to disk for further processing.

Thanks!






Rick Strahl
West Wind Technologies


from Lago de Garda, Italy

Making waves on the Web

Re: Container and Lines objects

$
0
0
Re: Container and Lines objects
FoxInCloud
Re: Container and Lines objects
Feb. 3, 2013
07:28 am
3PH0G09OWShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Michele
I suggest that you define your styles in xxx.css:
You can use their classes (such as .xxxlin{your style directives}) - reminder: in FoxinCloud, Lower(VFP classes) == CSS classes
and/or, if needed, add some custom CSS classes to these objects using xxxLin.wCSSclassAdd = 'yourAdditionalCSSclass(es)'; then you will have in xxx.css: .yourAdditionalCSSclass(es) {your style directives}


These ae the screenshots. The first in Lan mode (and the same is in the debug)

and the second is on iPad

I have no code to post because this form and the container in it are all inserted in form in design non with code

All the lines are not visible, in every style (sunken, plan, raised)


please post code and screenshot, hard to find without these ...
thanks


I downloaded the new version, but nothing has changed....do i need to do something particular ???????


We fixed that recently
Please download a current install from our server using the link on your notification email


I have inserted in one form some container class and line class, but when i show this form in browser i can't see the border and the lines as i defined in the form....






-- thn (FoxInCloud)

Re: New problem with containers

$
0
0
Re: New problem with containers
FoxInCloud
Re: New problem with containers
Feb. 3, 2013
07:49 am
3PH0GR7OPShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Michele
Michele,
Can you confirm
ThisForm.D1.wlContentDynamic = .T.
?

I ask you this because it looks like the appointment style is added to dynamic CSS instead of in-line style="" attribute, as of normal awHTML.prg behavior.

If possible, can you post the server xml response when you add this appointment container?
You can get it from the server form inside IDE, click the 'show status' button, then 'last HTML output'.


I have a form with some containers in it. With a button i add runtime some objects in one of thiese container, in the first.
The code to add this object is

ThisForm.D1.clearApps ThisForm.D1.AddObject("A1","_appointment")With ThisForm.D1.A1 .Height = 200 .Tag = "APP" .Top = 250 .Left = 1 ._Label1.Caption = "Demo COGEN" .Visible = .T.EndWith ThisForm.D1.wlContentChanged = .T. ThisForm.Refresh

Where clearApp is a method that clean all the objects already contained in D1 that is the container

When i open the form the first time it appears as in this image

after i click the button to add objects it changes, but the object is not added where i ask (the object has top=250 while in the form it seems at 0 and also the height is not correct. Iy has the properties i defined in the object class)

If i close the form (with the button we found in awcmdok) and the i open the form again i see the form without object in the container (even if in the debug it has still the object)

and when i add newly the object with my button (as i do the first time) the object is added in the correct position

What do i need to do to add the object without problems. This form must show user's appointment in week view....

Thanks



-- thn (FoxInCloud)

Re: Container and Lines objects

$
0
0
Re: Container and Lines objects
FoxInCloud
Re: Container and Lines objects
Feb. 3, 2013
07:51 am
3PH0GU5T0Show this entire thread in new window
Can you send me an example on how to define the style for a container where i wanto to see the border in sunken style ? Ad please look at the other problem i sent....


I suggest that you define your styles in xxx.css:
You can use their classes (such as .xxxlin{your style directives}) - reminder: in FoxinCloud, Lower(VFP classes) == CSS classes
and/or, if needed, add some custom CSS classes to these objects using xxxLin.wCSSclassAdd = 'yourAdditionalCSSclass(es)'; then you will have in xxx.css: .yourAdditionalCSSclass(es) {your style directives}


These ae the screenshots. The first in Lan mode (and the same is in the debug)

and the second is on iPad

I have no code to post because this form and the container in it are all inserted in form in design non with code

All the lines are not visible, in every style (sunken, plan, raised)


please post code and screenshot, hard to find without these ...
thanks


I downloaded the new version, but nothing has changed....do i need to do something particular ???????


We fixed that recently
Please download a current install from our server using the link on your notification email


I have inserted in one form some container class and line class, but when i show this form in browser i can't see the border and the lines as i defined in the form....






Re: Container and Lines objects

$
0
0
Re: Container and Lines objects
FoxInCloud
Re: Container and Lines objects
Feb. 3, 2013
07:58 am
3PH0H3WBBShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Michele
this is common CSS ... http://www.w3.org/TR/css3-background/#borders
e.g.
.myClass1.myClass2 {border: 2px inset #FFF; }

second parameter is 'border style' - you can choose between: dotted | dashed | solid | double | groove | ridge | inset | outset



Can you send me an example on how to define the style for a container where i wanto to see the border in sunken style ? Ad please look at the other problem i sent....


I suggest that you define your styles in xxx.css:
You can use their classes (such as .xxxlin{your style directives}) - reminder: in FoxinCloud, Lower(VFP classes) == CSS classes
and/or, if needed, add some custom CSS classes to these objects using xxxLin.wCSSclassAdd = 'yourAdditionalCSSclass(es)'; then you will have in xxx.css: .yourAdditionalCSSclass(es) {your style directives}


These ae the screenshots. The first in Lan mode (and the same is in the debug)

and the second is on iPad

I have no code to post because this form and the container in it are all inserted in form in design non with code

All the lines are not visible, in every style (sunken, plan, raised)


please post code and screenshot, hard to find without these ...
thanks


I downloaded the new version, but nothing has changed....do i need to do something particular ???????


We fixed that recently
Please download a current install from our server using the link on your notification email


I have inserted in one form some container class and line class, but when i show this form in browser i can't see the border and the lines as i defined in the form....








-- thn (FoxInCloud)

Re: Container and Lines objects

$
0
0
Re: Container and Lines objects
FoxInCloud
Re: Container and Lines objects
Feb. 3, 2013
08:00 am
3PH0H5ONAShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Michele

Re: New problem with containers

$
0
0
Re: New problem with containers
FoxInCloud
Re: New problem with containers
Feb. 3, 2013
12:02 pm
3PH0PTTLCShow this entire thread in new window
I have changed my class and instead of Container i use a button, but hte problem is the same...the first time the form is show and i add my buttons at runtime they are at the top of the container, if i close the form, or also if i call a wmessagebox, the form is "refreshed" and the buttons are in the correct position.

The HTML output of the first request /(hen the buttons are not in the correct position) is this:

HTTP/1.1 200 OK Content-type: text/xml Set-Cookie: mob=3OS0MM1B6; path=/; expires=Fri, 2 Aug 2013 23:00:00 GMT<?xml version='1.0' encoding='UTF-8' standalone='yes'?>trueboolean$('agenda_scx-d1').update('&#60;!-- Rendered in 036 ms --&#62;&#60;!-- Rendered in 015 ms --&#62;&#60;div id="agenda_scx-d1-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;label id="agenda_scx-d1-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;"&#62;Lunedì&#60;/label&#62;&#60;!-- agenda_scx-d1-_appointment1 --&#62;&#60;/div&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;button id="agenda_scx-d1-a1" class="commandbutton awcmd mobcmd _commandbutton _appointment1" style="display:block;" tabindex="542" onclick="FoxInCloud.DOMEvent(event)" type="button" autocomplete="off"&#62;Demo COGEN&#60;/button&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;button id="agenda_scx-d1-a2" class="commandbutton awcmd mobcmd _commandbutton _appointment1" style="display:block;" tabindex="543" onclick="FoxInCloud.DOMEvent(event)" type="button" autocomplete="off"&#62;Corso SAP&#60;/button&#62;'); $('agenda_scx-d2').update('&#60;!-- Rendered in 035 ms --&#62;&#60;!-- Rendered in 034 ms --&#62;&#60;div id="agenda_scx-d2-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;label id="agenda_scx-d2-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;"&#62;Martedì&#60;/label&#62;&#60;!-- agenda_scx-d2-_appointment1 --&#62;&#60;/div&#62;'); $('agenda_scx-d3').update('&#60;!-- Rendered in 017 ms --&#62;&#60;!-- Rendered in 015 ms --&#62;&#60;div id="agenda_scx-d3-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;label id="agenda_scx-d3-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;"&#62;Mercoledì&#60;/label&#62;&#60;!-- agenda_scx-d3-_appointment1 --&#62;&#60;/div&#62;'); $('agenda_scx-d4').update('&#60;!-- Rendered in 016 ms --&#62;&#60;!-- Rendered in 015 ms --&#62;&#60;div id="agenda_scx-d4-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;label id="agenda_scx-d4-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;"&#62;Giovedì&#60;/label&#62;&#60;!-- agenda_scx-d4-_appointment1 --&#62;&#60;/div&#62;'); $('agenda_scx-d5').update('&#60;!-- Rendered in 017 ms --&#62;&#60;!-- Rendered in 016 ms --&#62;&#60;div id="agenda_scx-d5-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;label id="agenda_scx-d5-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;"&#62;Venerdì&#60;/label&#62;&#60;!-- agenda_scx-d5-_appointment1 --&#62;&#60;/div&#62;'); $('agenda_scx-d6').update('&#60;!-- Rendered in 016 ms --&#62;&#60;!-- Rendered in 015 ms --&#62;&#60;div id="agenda_scx-d6-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;label id="agenda_scx-d6-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;"&#62;Sabato&#60;/label&#62;&#60;!-- agenda_scx-d6-_appointment1 --&#62;&#60;/div&#62;'); $('agenda_scx-d7').update('&#60;!-- Rendered in 017 ms --&#62;&#60;!-- Rendered in 015 ms --&#62;&#60;div id="agenda_scx-d7-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"&#62;&#60;!-- Rendered in 007 ms --&#62;&#60;label id="agenda_scx-d7-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;"&#62;Domenica&#60;/label&#62;&#60;!-- agenda_scx-d7-_appointment1 --&#62;&#60;/div&#62;'); var oForm = $('agenda_scx'); if(oForm && oForm.oWindow) oForm.oWindow.setTitle(oForm.oWindow.getTitle().sub(/&nbsp;- <a title=.+/i, '') + '&#38;nbsp;- &#60;a title="In case of trouble, click to send a support request by email FoxInCloud App" href="mailto:FoxInCloud App Admin&#60;appAdmin@yourDomain.com&#62;?subject=FoxInCloud App - trouble with form agenda_scx at Server: 09:02:19 PM"&#62;Server: 09:02:19 PM&#38;nbsp;&#60;img src="Images/email_error.png" style="vertical-align:text-top;" /&#62;&#60;/a&#62;');3OS0MM1B60.0131.2650.5347



Michele,
Can you confirm
ThisForm.D1.wlContentDynamic = .T.
?

I ask you this because it looks like the appointment style is added to dynamic CSS instead of in-line style="" attribute, as of normal awHTML.prg behavior.

If possible, can you post the server xml response when you add this appointment container?
You can get it from the server form inside IDE, click the 'show status' button, then 'last HTML output'.


I have a form with some containers in it. With a button i add runtime some objects in one of thiese container, in the first.
The code to add this object is

ThisForm.D1.clearApps ThisForm.D1.AddObject("A1","_appointment")With ThisForm.D1.A1 .Height = 200 .Tag = "APP" .Top = 250 .Left = 1 ._Label1.Caption = "Demo COGEN" .Visible = .T.EndWith ThisForm.D1.wlContentChanged = .T. ThisForm.Refresh

Where clearApp is a method that clean all the objects already contained in D1 that is the container

When i open the form the first time it appears as in this image

after i click the button to add objects it changes, but the object is not added where i ask (the object has top=250 while in the form it seems at 0 and also the height is not correct. Iy has the properties i defined in the object class)

If i close the form (with the button we found in awcmdok) and the i open the form again i see the form without object in the container (even if in the debug it has still the object)

and when i add newly the object with my button (as i do the first time) the object is added in the correct position

What do i need to do to add the object without problems. This form must show user's appointment in week view....

Thanks



FTP Passive Transfers

$
0
0
FTP Passive Transfers
West Wind Internet Protocols
FTP Passive Transfers
Feb. 3, 2013
02:07 pm
3PH0U9ZTHShow this entire thread in new window
Gratar Image based on email address
From:Rob Spencer
To:All
Hi Rick,

Our client has recently changed the network location of their servers to within their major firewall. We’re having some problems getting our FTP transfers to work.

I’ve modified the code to enable Passive FTP by setting the lPassiveFTP attribute on the FTP object. I’ve modified one of our applications to run an FTP upload with much more logging enabled. I’ve attached a few examples below to show the sort of things that I’ve thought of and tried.

Our application generates the output files that are to be transferred, so we’ve been able to transfer them to the remote FTP servers directly from the machine where we run our application using an ftp:// URL in Windows Explorer. It doesn’t work using the FTP client from the command line, which doesn’t support Passive mode. We’re running on Windows Server 2003 R2 SP1 (as a virtual machine) which has a direct outgoing FTP firewall rule, so no proxy server is required. Internet Explorer is configured to make only direct connections (and the proxy server would require a username/password). What all that waffle boils down to is that the FTP transfers do work, just not using our utility.

Latest build, run on-site:

<samp>
FTP via West Wind Web Connection 5.51
Connecting to janus.cnetdata.com as C04156
FTP Passive mode is On
Proxy Server is disabled
Connection Type : Direct
Connection Timeout : 25
Current folder : /
Changing current folder to Upload\
FTP Remote Folder change : Successful
Current folder : /Upload
Binary transfer is On
Failed to transfer D:\MFC04156.766 to Upload\, Error Code : 12002
FTP Message : The operation timed out
</samp>

This version of the application connects to the remote FTP server, checks a few of the setup properties, attempts to reset the lPassiveFTP property, set the remote directory and then uses FTPSendFileEx() to put the file on the remote server. Below I’ve also included a log file showing a successful transfer (on our test server) and the basic code (although you’ll just have to guess about some of the extra function calls). We’ve tried turning Passive mode off and it didn’t improve matters (I just wanted to make sure I hadn’t stuffed up the logic). Originally I was simply using FTPPutFile() but that didn’t work any better.

Latest build, run on test system:

<samp>
01/02/13 16:47:28 FTP via West Wind Web Connection 5.51
01/02/13 16:47:28 Connecting to qttest.ntl.quids.com.au as Quids\Web_Console
01/02/13 16:47:34 FTP Passive mode is On
01/02/13 16:47:34 Proxy Server is disabled
01/02/13 16:47:34 Connection Type : Direct
01/02/13 16:47:34 Connection Timeout : 25
01/02/13 16:47:34 Current folder : /
01/02/13 16:47:34 Changing current folder to incoming\
01/02/13 16:47:34 FTP Remote Folder change : Successful
01/02/13 16:47:34 Current folder : /incoming
01/02/13 16:47:34 Binary transfer is On
01/02/13 16:47:35 Uploaded 4096 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 8192 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 12288 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 16384 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 20480 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 24576 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 28672 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 32768 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 36864 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 40960 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 45056 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 49152 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 53248 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 57344 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 61440 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 65536 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 69632 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 73114 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 0 bytes of 73114 bytes
01/02/13 16:47:35 Transferred r:\dilbert\173028.strip.print.gif to incoming\
</samp>

Main Code :

defineclass FTPAction as action_q of ds_action.prg nResult= 0function process () as integer*: Overwritten to allow a numeric result to be passed backlocal nResult, cFileList, ii, oFTP, cFile, nFiles, lConnected, ; cFTPServer, cFTPUser, cFTPPwd, cFTPRemoteDir, nFileResult nResult= 0 lConnected= .f. oFTP= newoFTP() withthis .cStatus = "FTP via West Wind Web Connection " + transform(oFTP.cVersion)* Find the files to send cFileList= .Args("Files")* First check that each file exists nFiles= iif(empty(m.cFileList), 0, getwordcount(m.cFileList, ","))if m.nFiles = 0 .cStatus= "No files specified in FILES parameter" nResult= 1elsefor ii= 1 to m.nFiles cFile= alltrim(getwordnum(m.cFileList, m.ii, ","))if ! file(m.cFile) .cStatus= "Cannot locate file " + ltrim(str(m.ii)) + " <" + m.cFile + ">" nResult= 1endifendforendifif m.nResult = 0* Ok, all the files exist. Connect to the remote FTP server. cFTPServer= .Args("Server")ifempty(m.cFTPServer) cFTPServer= oG.iniRead("FTP Server")endif cFTPUser= .Args("Username")ifempty(m.cFTPUser) cFTPUser= oG.iniRead("FTP Username")endif cFTPPwd= .Args("Password")ifempty(m.cFTPPwd) cFTPPwd= oG.iniRead("FTP Password")endif cFTPRemoteDir= addbs(.Args("RemoteDir")) oFTP.cErrorMsg= "" .cStatus= "Connecting to " + m.cFTPServer + " as " + m.cFTPUser nResult= oFTP.ftpconnect(m.cFTPServer, m.cFTPUser, m.cFTPPwd)if m.nResult # 0 .cStatus= "Could not connect to server " + m.cServer ; + ", Error Code : " + ltrim(str(m.nResult))else lConnected= .t. .cStatus= "FTP Passive mode is " + iif(oFTP.lPassiveFtp, "On", "Off")if oFTP.lPassiveFtp* jic the connection has to be open first oFTP.lPassiveFtp= .t.endififempty(oFTP.cHTTPProxyName) .cStatus= "Proxy Server is disabled"else .cStatus= "Proxy Server is set to <" + oFTP.cHTTPProxyName + ">" .cStatus= "Proxy Username is set to <" + oFTP.cHTTPProxyUsername + ">"endif .cStatus= "Connection Type : " + icase(oFTP.nHTTPConnectType = 0, "IE Settings", ; oFTP.nHTTPConnectType = 1, "Direct", "Proxy") .cStatus= "Connection Timeout : " + ltrim(str(oFTP.nConnectTimeout))endifif !empty(oFTP.cErrorMsg) .cStatus= "FTP Message : " + oFTP.cErrorMsgendifendifif m.nResult = 0 .cStatus= "Current folder : " + oFTP.FTPGetCurrDir() .cStatus= "Changing current folder to " + m.cFTPRemoteDir .cStatus= "FTP Remote Folder change : " + iif(oFTP.FTPSetCurrDir(m.cFTPRemoteDir), "Successful", "Failed") .cStatus= "Current folder : " + oFTP.FTPGetCurrDir() .cStatus= "Binary transfer is " + iif(oFTP.nFTPBinary = 1, "On", "Off")bindevent(oFTP, "OnFTPBufferUpdate", this, "OnFTPBufferUpdate", 1)for ii= 1 to m.nFiles cFile= alltrim(getwordnum(m.cFileList, m.ii, ",")) oFTP.cErrorMsg= "" nFileResult= oFTP.FTPSendFileEx(m.cFile, justfname(m.cFile))if m.nFileResult = 0 .cStatus= "Transferred " + m.cFile + " to " + m.cFTPRemoteDirelse .cStatus= "Failed to transfer " + m.cFile + " to " + m.cFTPRemoteDir ; + ", Error Code : " + ltrim(str(m.nFileResult))* Returns the first non-zero error code - that's where the rot starts! nResult= evl(m.nResult, m.nFileResult)endifif !empty(oFTP.cErrorMsg) .cStatus= "FTP Message : " + oFTP.cErrorMsgendifendforendifif m.lConnected oFTP.ftpclose()endifendwithreturn m.nResultendfunc&& process()procedure OnFTPBufferUpdate (lnbytesdownloaded,lnbufferreads,lccurrentchunk, lnTotalBytes)withthis .cStatus= "Uploaded " + ltrim(str(m.lnbytesdownloaded)) + " bytes of " + ltrim(str(lnTotalBytes)) + " bytes"endwithendproc&& OnFTPBufferUpdate()enddefine

Do you have any suggestions? Are there any other utilities that I can use to check why it isn’t working? Do I need to wait until the connection is open to set the value of lPassiveFTP? As I said, I’ve tried resetting it once the connection is open but I am actually setting it in the init() of the FTP object already. Does it need to change from .f. to .t.? I’m clutching at straws there I think but I’ve run out of ideas. We run numerous FTP transfers to a variety of other businesses and none of them are working. We have monitored the other end of the transfers and the remote file is initially created (0 bytes) but no data seems to actually be transferred.

Hoping you have more idea than I do. Thanks,
Rob Spencer

Re: New problem with containers

$
0
0
Re: New problem with containers
FoxInCloud
Re: New problem with containers
Feb. 4, 2013
12:41 am
3PI01H5VBShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Michele
Michele,
Can you make sure of this?
ThisForm.D?.wlContentDynamic = .T. && at design time

Thanks,


I have changed my class and instead of Container i use a button, but hte problem is the same...the first time the form is show and i add my buttons at runtime they are at the top of the container, if i close the form, or also if i call a wmessagebox, the form is "refreshed" and the buttons are in the correct position.

The HTML output of the first request /(hen the buttons are not in the correct position) is this:

HTTP/1.1 200 OK Content-type: text/xml Set-Cookie: mob=3OS0MM1B6; path=/; expires=Fri, 2 Aug 2013 23:00:00 GMT<?xml version='1.0' encoding='UTF-8' standalone='yes'?>trueboolean$('agenda_scx-d1').update('<!-- Rendered in 036 ms --><!-- Rendered in 015 ms --><div id="agenda_scx-d1-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"><!-- Rendered in 007 ms --><label id="agenda_scx-d1-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;">Lunedì</label><!-- agenda_scx-d1-_appointment1 --></div><!-- Rendered in 007 ms --><button id="agenda_scx-d1-a1" class="commandbutton awcmd mobcmd _commandbutton _appointment1" style="display:block;" tabindex="542" onclick="FoxInCloud.DOMEvent(event)" type="button" autocomplete="off">Demo COGEN</button><!-- Rendered in 007 ms --><button id="agenda_scx-d1-a2" class="commandbutton awcmd mobcmd _commandbutton _appointment1" style="display:block;" tabindex="543" onclick="FoxInCloud.DOMEvent(event)" type="button" autocomplete="off">Corso SAP</button>'); $('agenda_scx-d2').update('<!-- Rendered in 035 ms --><!-- Rendered in 034 ms --><div id="agenda_scx-d2-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"><!-- Rendered in 007 ms --><label id="agenda_scx-d2-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;">Martedì</label><!-- agenda_scx-d2-_appointment1 --></div>'); $('agenda_scx-d3').update('<!-- Rendered in 017 ms --><!-- Rendered in 015 ms --><div id="agenda_scx-d3-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"><!-- Rendered in 007 ms --><label id="agenda_scx-d3-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;">Mercoledì</label><!-- agenda_scx-d3-_appointment1 --></div>'); $('agenda_scx-d4').update('<!-- Rendered in 016 ms --><!-- Rendered in 015 ms --><div id="agenda_scx-d4-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"><!-- Rendered in 007 ms --><label id="agenda_scx-d4-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;">Giovedì</label><!-- agenda_scx-d4-_appointment1 --></div>'); $('agenda_scx-d5').update('<!-- Rendered in 017 ms --><!-- Rendered in 016 ms --><div id="agenda_scx-d5-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"><!-- Rendered in 007 ms --><label id="agenda_scx-d5-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;">Venerdì</label><!-- agenda_scx-d5-_appointment1 --></div>'); $('agenda_scx-d6').update('<!-- Rendered in 016 ms --><!-- Rendered in 015 ms --><div id="agenda_scx-d6-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"><!-- Rendered in 007 ms --><label id="agenda_scx-d6-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;">Sabato</label><!-- agenda_scx-d6-_appointment1 --></div>'); $('agenda_scx-d7').update('<!-- Rendered in 017 ms --><!-- Rendered in 015 ms --><div id="agenda_scx-d7-_appointment1" class="container awcnt mobcnt _container _appointment" style="display:block;"><!-- Rendered in 007 ms --><label id="agenda_scx-d7-_appointment1-_label1" class="label awlbl moblbl _label" style="text-align:center;background:transparent;color:#0000FF;cursor:pointer;width:131px;height:59px;display:block;font:16pt \'Trebuchet MS\';left:-8px;top:1px;">Domenica</label><!-- agenda_scx-d7-_appointment1 --></div>'); var oForm = $('agenda_scx'); if(oForm && oForm.oWindow) oForm.oWindow.setTitle(oForm.oWindow.getTitle().sub(/ - <a title=.+/i, '') + '&nbsp;- <a title="In case of trouble, click to send a support request by email FoxInCloud App" href="mailto:FoxInCloud App Admin<appAdmin@yourDomain.com>?subject=FoxInCloud App - trouble with form agenda_scx at Server: 09:02:19 PM">Server: 09:02:19 PM&nbsp;<img src="Images/email_error.png" style="vertical-align:text-top;" /></a>');3OS0MM1B60.0131.2650.5347



Michele,
Can you confirm
ThisForm.D1.wlContentDynamic = .T.
?

I ask you this because it looks like the appointment style is added to dynamic CSS instead of in-line style="" attribute, as of normal awHTML.prg behavior.

If possible, can you post the server xml response when you add this appointment container?
You can get it from the server form inside IDE, click the 'show status' button, then 'last HTML output'.


I have a form with some containers in it. With a button i add runtime some objects in one of thiese container, in the first.
The code to add this object is

ThisForm.D1.clearApps ThisForm.D1.AddObject("A1","_appointment")With ThisForm.D1.A1 .Height = 200 .Tag = "APP" .Top = 250 .Left = 1 ._Label1.Caption = "Demo COGEN" .Visible = .T.EndWith ThisForm.D1.wlContentChanged = .T. ThisForm.Refresh

Where clearApp is a method that clean all the objects already contained in D1 that is the container

When i open the form the first time it appears as in this image

after i click the button to add objects it changes, but the object is not added where i ask (the object has top=250 while in the form it seems at 0 and also the height is not correct. Iy has the properties i defined in the object class)

If i close the form (with the button we found in awcmdok) and the i open the form again i see the form without object in the container (even if in the debug it has still the object)

and when i add newly the object with my button (as i do the first time) the object is added in the correct position

What do i need to do to add the object without problems. This form must show user's appointment in week view....

Thanks





Thierry Nivelet (FoxInCloud)
Never explain, never complain (Queen Elizabeth II)

Re: Screen with Modal form

$
0
0
Re: Screen with Modal form
FoxInCloud
Re: Screen with Modal form
Feb. 4, 2013
12:50 am
3PI01ST8WShow this entire thread in new window
Gratar Image based on email address
From:Thierry Nivelet (FoxInCloud)
To:Michele
Michele,

Could you please try to add this in xxx.css:

#overlay_modal {height:100%!important;}

Thanks,


Nothing seems to change...


please try this:
MODIFY FILE Scripts\Window1.3\window.js
replace
$('overlay_modal').setStyle({height: (pageSize.pageHeight + 'px')});
by
$('overlay_modal').setStyle({height: '100%'}); /* $('overlay_modal').setStyle({height: (pageSize.pageHeight + 'px')}); */


Normally i work in horizontal orientation, but i can't exclude to have also worked in vertical mode. Not today.....


did you change you iPad's orientation in between ?


When i call a modal form all the objects under the new form are covered with a particular skin......the problem is that this skin doesn't cover all my app's screen. See the image below

Where can i define it ?






Thierry Nivelet (FoxInCloud)
Never explain, never complain (Queen Elizabeth II)

Re: FTP Passive Transfers

$
0
0
Re: FTP Passive Transfers
West Wind Internet Protocols
Re: FTP Passive Transfers
Feb. 4, 2013
01:30 am
3PI0387KNShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Rob Spencer
Rob,

Error 12002 is a WinInet timeout error. I'm not sure what would cause that exactly since it appears (from the logs you sent) that the upload is proceeding properly, but the final save of the data seems to fail.

Is it possible there's a permissions problem on the server that doesn't allow the final file to be written? Are you logging in properly to access the upload folder and does that folder have write permissions to accept files? Does the file you're writing to exist on the server already - if so maybe delete it first with FTP commands.

My guess it's permissions of some sort...

You can also try using FtpSendFileEx2() with the same signature - it uses another, simpler WinInet API to send the file, which sometimes produces different behavior. In Help Builder's FTP upload which can send thousands of files that's what I use and it works well.

If you still have problems I suggest you use a simpler repro scenario. Just create a simple step by step program that configures the FTP connection and sends a single (or two files) to see whether you can connect and upload a file. It'll be easier to debug and trace than the full app code you posted.

Note there's not a lot of debugging that can be done of the WinInet connection. FtpConnect() doesn't actually connect - the connection doesn't occur until you perform a task (like sending a file or changing a directory) that uses the connection.

+++ Rick ----


Hi Rick,

Our client has recently changed the network location of their servers to within their major firewall. We’re having some problems getting our FTP transfers to work.

I’ve modified the code to enable Passive FTP by setting the lPassiveFTP attribute on the FTP object. I’ve modified one of our applications to run an FTP upload with much more logging enabled. I’ve attached a few examples below to show the sort of things that I’ve thought of and tried.

Our application generates the output files that are to be transferred, so we’ve been able to transfer them to the remote FTP servers directly from the machine where we run our application using an ftp:// URL in Windows Explorer. It doesn’t work using the FTP client from the command line, which doesn’t support Passive mode. We’re running on Windows Server 2003 R2 SP1 (as a virtual machine) which has a direct outgoing FTP firewall rule, so no proxy server is required. Internet Explorer is configured to make only direct connections (and the proxy server would require a username/password). What all that waffle boils down to is that the FTP transfers do work, just not using our utility.

Latest build, run on-site:

<samp>
FTP via West Wind Web Connection 5.51
Connecting to janus.cnetdata.com as C04156
FTP Passive mode is On
Proxy Server is disabled
Connection Type : Direct
Connection Timeout : 25
Current folder : /
Changing current folder to Upload\
FTP Remote Folder change : Successful
Current folder : /Upload
Binary transfer is On
Failed to transfer D:\MFC04156.766 to Upload\, Error Code : 12002
FTP Message : The operation timed out
</samp>

This version of the application connects to the remote FTP server, checks a few of the setup properties, attempts to reset the lPassiveFTP property, set the remote directory and then uses FTPSendFileEx() to put the file on the remote server. Below I’ve also included a log file showing a successful transfer (on our test server) and the basic code (although you’ll just have to guess about some of the extra function calls). We’ve tried turning Passive mode off and it didn’t improve matters (I just wanted to make sure I hadn’t stuffed up the logic). Originally I was simply using FTPPutFile() but that didn’t work any better.

Latest build, run on test system:

<samp>
01/02/13 16:47:28 FTP via West Wind Web Connection 5.51
01/02/13 16:47:28 Connecting to qttest.ntl.quids.com.au as Quids\Web_Console
01/02/13 16:47:34 FTP Passive mode is On
01/02/13 16:47:34 Proxy Server is disabled
01/02/13 16:47:34 Connection Type : Direct
01/02/13 16:47:34 Connection Timeout : 25
01/02/13 16:47:34 Current folder : /
01/02/13 16:47:34 Changing current folder to incoming\
01/02/13 16:47:34 FTP Remote Folder change : Successful
01/02/13 16:47:34 Current folder : /incoming
01/02/13 16:47:34 Binary transfer is On
01/02/13 16:47:35 Uploaded 4096 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 8192 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 12288 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 16384 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 20480 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 24576 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 28672 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 32768 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 36864 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 40960 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 45056 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 49152 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 53248 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 57344 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 61440 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 65536 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 69632 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 73114 bytes of 73114 bytes
01/02/13 16:47:35 Uploaded 0 bytes of 73114 bytes
01/02/13 16:47:35 Transferred r:\dilbert\173028.strip.print.gif to incoming\
</samp>

Main Code :

defineclass FTPAction as action_q of ds_action.prg nResult= 0function process () as integer*: Overwritten to allow a numeric result to be passed backlocal nResult, cFileList, ii, oFTP, cFile, nFiles, lConnected, ; cFTPServer, cFTPUser, cFTPPwd, cFTPRemoteDir, nFileResult nResult= 0 lConnected= .f. oFTP= newoFTP() withthis .cStatus = "FTP via West Wind Web Connection " + transform(oFTP.cVersion)* Find the files to send cFileList= .Args("Files")* First check that each file exists nFiles= iif(empty(m.cFileList), 0, getwordcount(m.cFileList, ","))if m.nFiles = 0 .cStatus= "No files specified in FILES parameter" nResult= 1elsefor ii= 1 to m.nFiles cFile= alltrim(getwordnum(m.cFileList, m.ii, ","))if ! file(m.cFile) .cStatus= "Cannot locate file " + ltrim(str(m.ii)) + " <" + m.cFile + ">" nResult= 1endifendforendifif m.nResult = 0* Ok, all the files exist. Connect to the remote FTP server. cFTPServer= .Args("Server")ifempty(m.cFTPServer) cFTPServer= oG.iniRead("FTP Server")endif cFTPUser= .Args("Username")ifempty(m.cFTPUser) cFTPUser= oG.iniRead("FTP Username")endif cFTPPwd= .Args("Password")ifempty(m.cFTPPwd) cFTPPwd= oG.iniRead("FTP Password")endif cFTPRemoteDir= addbs(.Args("RemoteDir")) oFTP.cErrorMsg= "" .cStatus= "Connecting to " + m.cFTPServer + " as " + m.cFTPUser nResult= oFTP.ftpconnect(m.cFTPServer, m.cFTPUser, m.cFTPPwd)if m.nResult # 0 .cStatus= "Could not connect to server " + m.cServer ; + ", Error Code : " + ltrim(str(m.nResult))else lConnected= .t. .cStatus= "FTP Passive mode is " + iif(oFTP.lPassiveFtp, "On", "Off")if oFTP.lPassiveFtp* jic the connection has to be open first oFTP.lPassiveFtp= .t.endififempty(oFTP.cHTTPProxyName) .cStatus= "Proxy Server is disabled"else .cStatus= "Proxy Server is set to <" + oFTP.cHTTPProxyName + ">" .cStatus= "Proxy Username is set to <" + oFTP.cHTTPProxyUsername + ">"endif .cStatus= "Connection Type : " + icase(oFTP.nHTTPConnectType = 0, "IE Settings", ; oFTP.nHTTPConnectType = 1, "Direct", "Proxy") .cStatus= "Connection Timeout : " + ltrim(str(oFTP.nConnectTimeout))endifif !empty(oFTP.cErrorMsg) .cStatus= "FTP Message : " + oFTP.cErrorMsgendifendifif m.nResult = 0 .cStatus= "Current folder : " + oFTP.FTPGetCurrDir() .cStatus= "Changing current folder to " + m.cFTPRemoteDir .cStatus= "FTP Remote Folder change : " + iif(oFTP.FTPSetCurrDir(m.cFTPRemoteDir), "Successful", "Failed") .cStatus= "Current folder : " + oFTP.FTPGetCurrDir() .cStatus= "Binary transfer is " + iif(oFTP.nFTPBinary = 1, "On", "Off")bindevent(oFTP, "OnFTPBufferUpdate", this, "OnFTPBufferUpdate", 1)for ii= 1 to m.nFiles cFile= alltrim(getwordnum(m.cFileList, m.ii, ",")) oFTP.cErrorMsg= "" nFileResult= oFTP.FTPSendFileEx(m.cFile, justfname(m.cFile))if m.nFileResult = 0 .cStatus= "Transferred " + m.cFile + " to " + m.cFTPRemoteDirelse .cStatus= "Failed to transfer " + m.cFile + " to " + m.cFTPRemoteDir ; + ", Error Code : " + ltrim(str(m.nFileResult))* Returns the first non-zero error code - that's where the rot starts! nResult= evl(m.nResult, m.nFileResult)endifif !empty(oFTP.cErrorMsg) .cStatus= "FTP Message : " + oFTP.cErrorMsgendifendforendifif m.lConnected oFTP.ftpclose()endifendwithreturn m.nResultendfunc&& process()procedure OnFTPBufferUpdate (lnbytesdownloaded,lnbufferreads,lccurrentchunk, lnTotalBytes)withthis .cStatus= "Uploaded " + ltrim(str(m.lnbytesdownloaded)) + " bytes of " + ltrim(str(lnTotalBytes)) + " bytes"endwithendproc&& OnFTPBufferUpdate()enddefine

Do you have any suggestions? Are there any other utilities that I can use to check why it isn’t working? Do I need to wait until the connection is open to set the value of lPassiveFTP? As I said, I’ve tried resetting it once the connection is open but I am actually setting it in the init() of the FTP object already. Does it need to change from .f. to .t.? I’m clutching at straws there I think but I’ve run out of ideas. We run numerous FTP transfers to a variety of other businesses and none of them are working. We have monitored the other end of the transfers and the remote file is initially created (0 bytes) but no data seems to actually be transferred.

Hoping you have more idea than I do. Thanks,
Rob Spencer




Rick Strahl
West Wind Technologies


from Lago de Garda, Italy

Making waves on the Web

Viewing all 10393 articles
Browse latest View live