Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

CkPython Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
FileAccess
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(Python) Upload Files to a Web Server - Simplest Example

This is the simplest example for uploading some files to a web server. the BlockingUpload call is synchronous and returns when the upload is finished (or failed).

A server-side C# example showing how to receive an upload is located at C# ASP.NET Code to Receive Upload

Chilkat Python Downloads

Python Module for Windows, Linux, Alpine Linux,
MAC OS X, Solaris, FreeBSD, OpenBSD,
Raspberry Pi and other single board computers

import chilkat

upload = chilkat.CkUpload()

#  Specify the page (ASP, ASP.NET, Perl, Python, Ruby, CGI, etc)
#  that will receive and process the HTTP Upload.
upload.put_Hostname("www.mywebserver.com")
upload.put_Path("/receiveUpload.aspx")

#  Add one or more files to be uploaded.
upload.AddFileReference("file1","dude.gif")
upload.AddFileReference("file2","swordfish.xml")
upload.AddFileReference("file3","sample.doc")

#  Do the upload.  The method returns when the upload
#  is completed.
#  This component also includes asynchronous upload capability,
#  which is demonstrated in another example.
success = upload.BlockingUpload()
if (success != True):
    print(upload.lastErrorText())
else:
    print("Files uploaded!")


 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.