Login  
Search All Forums
Dart Home | PowerTCP Web Enterprise for ActiveX | Custom Development Reply | PowerTCP Web Enterprise for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web Enterprise for ActiveX
Topic: StatusText returns OK. But file not uploaded
karthiksp

From: West Palm Beach, FL USA
Posts: 60
Member Since: 08/04/05
posted October 7, 2008 4:56 PM

Hi,

  I am using the following code to upload a file in the Secure FTP Control. I am getting the StatusText as 'OK' but file is not uploaded in the site.

I am using Powerbuilder Version 11.0

Could somone help me.

ole_webasp.object.Request.Content = ""
ole_webasp.object.Request.Version = 2

ole_webasp.object.Request.Url = "https://boa.com"
ole_webasp.object.Request.Body.FileMode = 1
ole_webasp.object.Request.Body.FileName = "C:\Documents and Settings\ARP013.TXT"
ole_webasp.object.Request.Body.Ref = "File1"
ole_webasp.Object.Timeout = 30000
ole_webasp.Object.Request.Username = "UserName"
ole_webasp.Object.Request.Password = "Password"

ole_webasp.object.Put()

Messagebox('', String(ole_webasp.object.Response.StatusText()))


Any small hint or help would help me.

Karthik
Jason Farrar (Admin)

From: USA
Posts: 223
Member Since: 07/24/07

Extra Support Options
Custom Application Development

posted October 20, 2008 12:50 PM

Hi Karthik,
  I'm a little confused, you say you are trying to upload a file with the SecureFTP Control but the code you have given is for the Web ASP control. Are trying to put a file to an FTP Server using the Web ASP control?
karthiksp

From: West Palm Beach, FL USA
Posts: 60
Member Since: 08/04/05
posted October 21, 2008 11:58 AM

Hi Jason,

    Thanks for the reply. So here is my requirement.

I have HTTP Secure Website that I need to upload files.

What control do I need to use to acomplish that.And also if you have sample code in VB or PB could you please pass it to me

Thanks
Karthik
Jason Farrar (Admin)

From: USA
Posts: 223
Member Since: 07/24/07

Extra Support Options
Custom Application Development

posted October 22, 2008 1:52 PM

Hi Karthik,

  You need to populate the FilesToPost property of the WebASP control. Here is some example code in VB:

  Dim dFiles As New DartStreams
  Dim dFile As New DartStream
  dFile.FileName = ".\testpost.txt" 'File to be posted
  dFile.FileMode = createOpen
  dFile.Ref = "testpost.txt"
  dFiles.Add dFile
 
  WebASP1.Request.Url = "https://test.com"
  WebASP1.Request.Username = "testuser"
  WebASP1.Request.Password = "TestPass"
  WebASP1.Request.Content = ""
  WebASP1.Request.Body.FileMode = createOpen
  WebASP1.Request.FilesToPost = dFiles
  WebASP1.Post
karthiksp

From: West Palm Beach, FL USA
Posts: 60
Member Since: 08/04/05
posted December 10, 2008 9:06 AM

HI Jason,

    Thanks for the reply. I tried the same way what you suggested. For your information, I am using POWERBUILDER as our Front-end product.

    I use the following script to post a file in HTTPS server. I am getting status OK. But the file is not uploaded. Could you please help me why it is not uploading.

    Concern is do I need to install any certificate in my computer where I am testing the upload file.

    Here is my coding I used to upload the file.

OLEObject dartStream
OLEObject dartStreams

dartStream = CREATE OLEObject
dartStream.ConnectToNewObject("Dart.DartStream")

dartStreams = CREATE OLEObject
dartStreams.ConnectToNewObject("Dart.DartStreams")

dartStream.FileName = "C:\test.txt"
dartStream.FileMode = 3
dartStream.Ref = "Karthik.txt"
dartStreams.Add(dartStream)

ole_webasp.Object.Request.Url = "https://st01.aetna.com"
ole_webasp.Object.Request.Content = ""
ole_webasp.Object.Request.Username = "XXXXXXX"
ole_webasp.Object.Request.Password = "XXXXXXX"

ole_webasp.Object.Request.Body.FileMode = 3
ole_webasp.Object.Request.FilesToPost = dartStreams
ole_webasp.Object.Post()

Messagebox('', String(ole_webasp.object.Response.StatusText()))


STATUS TEXT returns OK. But when I check in the server, I am not seeing the file. Could some one help me what am I doing wrong.

Karthik
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted December 30, 2008 8:52 AM

Hi Karthik,
I apologize for the delay in our response.
I just discovered your forum posts in our inbox.

Were you able to resolve this?
If not, try using the Trace method to see what the POST request and response look like.

Do you see your file data included in the Post?
If so, what does the response page look like (not just the status text)?

Thanks,
-ken
Reply | PowerTCP Web Enterprise for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX