Quantcast
Channel: Chilkat Forum - latest questions
Viewing all 1061 articles
Browse latest View live

Callback of SFTP in version 9.5.0.57 doesn't work now

$
0
0

None of my code was changed. Only use the different libs of chilkat. Callback of SFTP in version 9.5.0.57 doesn't work, But chilkat-9.5.0.52 still works.

All package are C++ MinGW.


Intermittent issues while connecting to SFTP.

$
0
0

Hello, My IIS webservice application connects to SFTP using ChilkatVersion: 9.5.0.46 It is able to get the documents however it intermittently fails with following error.

Error:ChilkatLog:
  Connect_SFtp:
    DllDate: Dec  5 2014
    ChilkatVersion: 9.5.0.46
    UnlockPrefix: ********
    Username: <user name="">
    Architecture: Little Endian; 32-bit
    Language: .NET 2.0
    VerboseLogging: 0
    SftpVersion: 0
    hostname: <host ip="" address="">
    port: 22
    Established TCP/IP connection with SSH server
    clientIdentifier: SSH-2.0-PuTTY_Release_0.63
    Sending client identifier...
    Done sending client identifier.
    Reading server version...
    Failed to read initial server version string
    bytesReceived: 
    Failed.
  --Connect_SFtp
--ChilkatLog

What i am not able to understand is what may cause this error to occur intermittently.

Could this be issue with Chilkat version or something to do with SFTP server.

Please help!

[EDIT 5/9/15]

Alright, i did following test, please see if you can help with this information.

This is the process I am trying to test. My webspplication runs on IIS which calls an SFTP server for some files. This is a webservice called by clients.

When i run this application on Win2k3 server with IIS 6, out of 200 calls i see this exception happening for 6-7 odd times I migrated this application as is on Win2k8 server with IIS 7.5 When I run it there, is see this exception happening for around 40 times out of 200 same calls.

Any clue why it may?

I am being told not to change the webservice code while doing migration, hence code change by upgrading Chilkat will be a last resort.

Please help!!

Thanks Santosh

which library in c++ should be used in wince 6?

$
0
0

I want to test the c++ library in wince 6. What type of c++ library should I choose? by the way, the IDE i used is vs2008 Thank you

Https Downloads on Windows 10 and windows 8

$
0
0

Https Downloads on Windows 10 and windows 8.

When multiple downloads are done with the code below and after about 20 successive downloads, and 1.5GB of data, windows 10 and 8 starts to lock up. Windows 7 works fine.

I suspect its to do with the MicrosoftWindowsINetCacheIE becoming full. No matter how I delete the cache files, it still locks the downloads up , and Chilkat throws an error up. On closer inspection, the cache creeps up to about 1.5GB-2GB of data files, and this is why I think this is happening.

Question, does the chilkat library with the code below download into the MicrosoftWindowsINetCacheIE cache, as this would explain the problem.

Using URLDownloadToFile in VB6 also has the same problem.


Set http = New ChilkatHttp Dim success As Long

' Any string unlocks the component for the 1st 30-days. success = http.UnlockComponent("Anything for 30-day trial") If (success <> 1) Then MsgBox http.LastErrorText Exit Sub End If

' Request AbortCheck events every .1 seconds http.HeartbeatMs = 100

' Give focus to the abort button: AbortBtn.SetFocus bAbort = False

' Download the Ruby language install ' Note: These URLs may have changed since this example was created. success = http.Download("url address", "file to save as") If (success <> 1) Then MsgBox http.LastErrorText Else MsgBox "Ruby Download Complete!" End If


purchasing (C++) Fortuna PRNG Generate Random Encoded

$
0
0

Hi,

I've been using the (C++) Fortuna PRNG Generate Random Encoded function, and the trial has expired.

How can I purchase it, because I don't know which bundle that includes this function!

50% CPU utilization with a Socket AcceptNextConnectionAsync process

$
0
0

The task manager shows a 50% CPU utilization.

I would understand that with a SYNC process but why with an ASYNC process ?

task = CkSocket_AcceptNextConnectionAsync(listenSocket,0);

if (CkSocket_getLastMethodSuccess(listenSocket) != TRUE)
goto labelend ;

if (!CkTask_Run(task))
{ CkTask_Dispose(task);
goto labelend ;
}

while (CkTask_getFinished(task) != TRUE)
CkTask_SleepMs(task,10); // Sleep 10 ms.

status = CkTask_getStatusInt(task) ;
if (status != 7) goto labelend ;

Thanks

C# async await Task.Delay

$
0
0

We have a series of web service api endpoints that we use that will do some movements of files via FTP and other web requests. Since the underlying processes task advantage of many of the async Task processes when we call things like .Wait/Result we will end up blocking (which is by design). For the sleep state for our methods, we're using the Task.Delay (as shown in the sample below).

This is my first shot of using Chilkat in an async fashion, If there was a better way of doing this or if this is at least a sane approach?

Second part of the question, wrapping the Chilkat.Ftp2 in a using statement, I haven't seen samples that show this, but I would assume since it's implements IDisposible that using the using syntax would be the ideal approach. Any advantages/disadvantages of this in the scope of Chilkat?

public async Task DeleteRemoteFileAsync(string url, string path, string filename, string username, string password, CancellationToken ct)
{
  try
  {
    List<string> fileList = new List<string>();
    using (Chilkat.Ftp2 ftp = _GetFTPConnection(url, username, password))
    {
      if (!ftp.ChangeRemoteDir(path))
      {
        throw new Exception(ftp.LastErrorText);
      }
      Chilkat.Task task = ftp.DeleteRemoteFileAsync(filename);
      if (task == null)
      {
        throw new Exception(ftp.LastErrorText);
      }
      if (!task.Run())
      {
        throw new Exception(ftp.LastErrorText);
      }
      while (!task.Finished && !ct.IsCancellationRequested)
      {
        //Sleep 100 ms.
        await Task.Delay(100, ct);
      }
      ftp.Disconnect();
    }
  }
  catch (Exception ex)
  {
    throw ex;
  }
}

private Chilkat.Ftp2 _GetFTPConnection(string url, string username, string password)
{
  try
  {
    Chilkat.Ftp2 ftp = new Chilkat.Ftp2();
    if (!ftp.UnlockComponent(CHILKATFTPKEY))
    {
      throw new Exception(ftp.LastErrorText);
    }
    if (!ftp.IsUnlocked())
    {
      throw new Exception("Chilkat.Ftp2 is not unlocked");
    }

    ftp.Hostname = url;
    if (!ftp.ConnectOnly())
    {
      throw new Exception(ftp.LastErrorText);
    }
    ftp.Username = username;
    ftp.Password = password;
    if (!ftp.LoginAfterConnectOnly())
    {
      throw new Exception(ftp.LastErrorText);
    }
    return ftp;
  }
  catch (Exception ex)
  {
    ex.Data["Url"] = url;
    ex.Data["Username"] = username;
    throw ex;
  }
}

TlsRenegotiate gives error

$
0
0

When I try no perform a TlsRenegotiate, it always fails with this error: ChilkatLog: TlsRenegotiate: ChilkatVersion: 9.5.0.56 socket2_tlsRenegotiate: clientRenegotiate: clientHandshake: clientHandshake2: readHandshakeMessages: processAlert: TlsAlert: level: fatal descrip: internal error --TlsAlert Closing connection in response to fatal SSL/TLS alert. --processAlert Aborting handshake because of fatal alert. --readHandshakeMessages --clientHandshake2 --clientHandshake --clientRenegotiate --socket2_tlsRenegotiate Failed. --TlsRenegotiate --ChilkatLog

Any idea why this is happening?


Bizarre copy of UNKNOWN in subroutine entry

$
0
0

Hi,

I'm currently testing the script http://www.example-code.com/perl/imap_downloadAttachment.asp on a Ubuntu 12.04 32 bit with perl 5.14.

There is only one email with a pdf file as attachment in the inbox.

There script extracts the attachment and saves it in the created directory. But the script then ends with the following error:

M1KKD.BI.20150910.1059416.000077.pdf Bizarre copy of UNKNOWN in subroutine entry at ./test.pl line 99.

When we add a second email with an attachment to the inbox, this email will not be processed.

I found only few postings on the net, telling me that this is an internal error in the module.

Does anyone have a hint or suggestion how to solve this?

Regards,

Stefan

Google scrape issue

$
0
0

I'm trying scrape google results useing http object in VBScript.

here is the code:

set http = CreateObject("Chilkat_9_5_0.Http")
success = http.UnlockComponent("xxxx.my.key.goes.here.xxx")

deleteFile curpath & "page.html"
deleteFile curpath & "httpSessionLog.txt"
deleteFile curpath & "urls.csv"

'http.FollowRedirects = 1
http.ProxyDomain = "xxx.xxx.xxx.xxx"    
http.ProxyPort = "xxxx"
http.MimicFireFox = "1"
'http.SessionLogFilename = curpath & "httpSessionLog.txt"
http.CookieDir = "memory"
http.SaveCookies = 1
http.SendCookies = 1

url = "https://www.google.com/webhp?#gl=us&hl=en&q=what+is+my+ip+address"
html = http.QuickGetStr(url)

I know google does redirects as well drops some cookies, but can't figure out how to get actual results. I keep geting initial google page with search box and no results.

Please help

SMTP Server says "Queued for Delivery", but Email Never Arrives

$
0
0

Would appreciate if you can shed some light on why does the log show that emails are not sent – instead they say “Queued mail for delivery”? According to the User (of my software), the email never goes out. This is happening (suddenly) to ALL their outgoing SMTP emails using Chilkat.

For example:

...
    dataCommand:
      SmtpCmdSent: DATA<CRLF>
      SmtpCmdResp: 354 Start mail input; end with <CRLF>.<CRLF>
    --dataCommand
    mimeDataSize: 234098
    smtpSendData: Elapsed time: 0 millisec
    endOfData:
      SmtpCmdSent: <CRLF>.<CRLF>
      SmtpCmdResp: 250 2.6.0 <x> [InternalId=x, Hostname=x] Queued mail for delivery
    --endOfData
    smtpFinalResponse: Elapsed time: 281 millisec
    smtpConversation: Elapsed time: 281 millisec
    Success.
  --SendEmail
--ChilkatLog

Get the string length of getEncodedW's return value?

$
0
0

Hi,

I may be missing something obvious. Sorry if so.

I would like to use the function getEncodedW from CkByteData. (With base64 encoding). const wchar_t getEncodedW(const wchar_t encoding);

However, the return wchar_t I am getting does not have a string terminator. How can I find out the size of the returned string?

Thanks.

DeleteRemoteFile(Async) failed because file is not found

$
0
0

Is it possible to extract this information (file not found) to handle that specific failure?

ErrorTextSnippit:

ChilkatLog:
DeleteRemoteFile:
DllDate: Dec 29 2015
ChilkatVersion: 9.5.0.55
Architecture: Little Endian; 32-bit
Language: .NET 4.5
VerboseLogging: 0
filename: [topTapi2.ocx]
deleteFile:
  simplePathCommand:
    simpleCommand:
      sendCommand:
        sendingCommand: DELE topTapi2.ocx
      --sendCommand
      readCommandResponse:
        replyLineQP: 550 File not found
      --readCommandResponse
    --simpleCommand
    Simple path command failed.
    statusCode: 550
    reply: 550 File not found
  --simplePathCommand
--deleteFile
Failed.

--DeleteRemoteFile --ChilkatLog

C# Async/Await with Async-Methods

$
0
0

Hello,

will there be async/await support for the async-methods? (Your Task implementation isn't awaitable)

Could not load file or assembly ‘ChilkatDotNet46.dll’

$
0
0

I'm using VS 2015 on Win Svr 2012 R2 machine

I was using the ...DotNet4.dll for my Win 7 user environment. I switched some machines to Win 10 and it no longer worked.

I changed VS to point to 4.6, added ...DotNet4.6.dll, built and it works on my Win 10 machines. However, it will now not work on my Win 7 machines.

I added Framework 4.6(4.53) and 4.61 to Win 7, and it still fails.

Do I need to maintain 2 different builds? Or, am I missing something that was already discussed here.

Thanks.


get data from webservice with x509

$
0
0

Hello,

I have to get data from a webservice (described as "like REST") , the site needs a certificate. We send some data in XML form but as contenttype text/plain (dont ask:-) ) and receive some data in XML form.

We have different certificates on the pc, so the one to be used comes from a file (see down)

In the next lines there is code from our working c# solution. But now need to do implement it in another project in VFP and want to use chilkat for it (which we use for ftp,..)

Can you give me a hint where to start or some code ?

Thanks a lot in advance tom

Here is the main part of the c# program :

namespace WebClientService

{ public class WebClient

{
    private readonly ILog _log;
    public WebClient()

    public string SendData(string uri, String xmlData)
    {

        var url = new Uri(uri);
        SecureWebClient client = new SecureWebClient();

       var response =client.UploadString(url, xmlData);

       _log.Debug(response);

        return response.ToString();

    }

    class SecureWebClient : System.Net.WebClient
    {

        protected override WebRequest GetWebRequest(Uri address)
        {
            HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address);

            ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
            //ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
            X509Certificate myCert =  X509Certificate2.CreateFromCertFile("ClientCertificate.cer");
            request.ClientCertificates.Add(myCert);
            return request;
        }
    }

}

}

calling a webservice method.

$
0
0

Hello.

I have to call a function on a webservice with the following syntax:

Delivery(Username As String, Name As String, AccessID as string, XMLFile As String) As String

The webservice address is something like:

http://www.website.com/delivdev/delivery.asmx?wsdl

The XMLfile is in Utf-8 and contains several items to be exported, according to an XSD file that validates the XML file I create.

How can I do this using Chilkat activeX ( for example in FoxPro )?

Thanks,

Carlos

OLE error Code 0x80070005: Access is denied

$
0
0

Hi there

I want to test the smtp component for visual foxpro 9 on windows7 (64bit) to send embeded pictures via smtp. I have local admin rights and installed/registered with register_win32.bat successfully.

When I start the demo prgramm i got an error message on this line: loMailman = CreateObject('Chilkat_9_5_0.MailMan')

Error windows with: OLE error Code 0x80070005: Access is denied

can you help me?

Problem with attached email messages in an email

$
0
0

Hi,

I have a problem handling attached messages (MSG) in an email. I use Chilkat 64-bit .NET 4.5 version 9.5.0.54.

Question 1: When I received an email from Outlook 2013 with an attached email message the number of attachments properties for the Email object are like this: NumAttachments is 0 NumAttachedMessages is 1

When I create an email from Outlook 2015 with an attached email message I have the following: NumAttachments is 1 NumAttachedMessages is 1

Have you seen this before?

Question 2: Furthermore, the filename of the attached email message is always "attachedFile.mht" even though the original filename is different. What is happening?

Question 3: When I have more attachments to an email (1 PDF file and 1 email messages) I have trouble getting data by attachment index. Some indexes are defined as "the Nth attached (embedded) email" and others as "the Nth attachment". Is it possible to distinguish between indexes of attached files and attached messages? For instance an attached message can both be the first attached message but the second attachment. This is confusing.

Hope you have time to answer my questions.

Best regards Kristian

System.AccessViolationException randomly in Ftp2

$
0
0

The error below happens randomly, and because of the error type it seems that I can't catch this error on .Net 4.5. I suspect that the bug happens when a connection is dropped while reading. Our process runs on a less than reliable network, with built in retry, but when this error occurs the application just dies. What makes this worse is that it's in an thread and when that thread dies all of the other processes running halt as well.

Ideally I would really just like to be able to gracefully handle the error and push a normalize error up the stack, but I can't do it in this case.

Thoughts?

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at ClsTask.GetResultInt(ClsTask* )
   at Chilkat.Task.GetResultInt()
   at gsmith.Lib.FTP.<GetFileListAsync>d__1a.MoveNext() in c:\USB\Source\ECommerce\gsmith\gsmith.Lib\FTP.cs:line 297
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(Action action, Boolean allowInlining, Task& currentTask)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1.TrySetResult(TResult result)
   at System.Threading.Tasks.Task.DelayPromise.Complete()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()

Here is the offending method:

public async Task<List<string>> GetFileListAsync(string url, string path, string username, string password, string filter, TimeSpan minAge, CancellationToken ct)
{
  try
  {
    List<string> fileList = new List<string>();
    using (Chilkat.Ftp2 ftp = _GetFTPConnection(url, username, password))
    {
      if (!ftp.ChangeRemoteDir(path))
      {
        throw new JBApiException(ftp.LastErrorText);
      }
      Chilkat.Task task = ftp.GetDirCountAsync();
      if (task == null)
      {
        throw new JBApiException(ftp.LastErrorText);
      }
      if (!task.Run())
      {
        throw new JBApiException(ftp.LastErrorText);
      }
      while (!task.Finished && !ct.IsCancellationRequested)
      {
        //Sleep 100 ms.
        await Task.Delay(100, ct);
      }
      if (!ct.IsCancellationRequested)
      {
        int n = task.GetResultInt();
        if (n > 0)
        {
          //  Loop over the directory contents, incrementing the count
          //  each time it is NOT a directory.
          int fileCount = 0;
          for (int i = 0; i <= n - 1; i++)
          {
            //  Is this NOT a sub-directory?
            if (!ftp.GetIsDirectory(i))
            {
              fileCount = fileCount + 1;
              fileList.Add(ftp.GetFilename(i));
            }
          }
          System.Diagnostics.Debug.WriteLine(string.Format("Files: {0}", fileList.Count));
        }
      }
      ftp.Disconnect();
      return fileList;
    }
  }
  catch (Exception ex)
  {
    if (!(ex is JBApiException))
    {
      ex = new JBApiException(ex.Message, ex, false);
    }
    ex.Data["Url"] = url;
    ex.Data["Path"] = path;
    ex.Data["Filter"] = filter;
    ex.Data["Username"] = username;
    ex.Data["Password"] = password;
    throw ex;
  }
}
Viewing all 1061 articles
Browse latest View live