Multipart form post

This forum is for general support of Xbase++
Post Reply
Message
Author
BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Multipart form post

#1 Post by BruceN »

Hello,

My name is Andrew and I'm working with Bruce on a project to integrate with some other software over HTTP. We've been able to use the LoadURL to post data to the web service, but we also want to post multipart form data so that files can be uploaded to the web server. I couldn't find any examples of how to post a file using the LoadURL function; could anybody provide a couple lines of example code on how to read afile and then post the data using the LoadURL function? Or at least guidance on where to look?

Thanks in advance,
Andrew
There are only 10 kinds of people - those who understand binary and those who don't :)

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Multipart form post

#2 Post by BruceN »

Another question for same project: is there a SIMPLE html editor that we can use in or in or instead of a dc_memoedit?

tnx,

bruce
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Multipart form post

#3 Post by rdonnay »

Are you wanting to do this inside an Xbase++ application or in a web browser?

Can I assume that you have your own web server?

Are you using Xbase++ and Xb2.Net as your web server or is it IIS or Apache?

Jack Duijf submitted code for an HTML editor long ago.
You can search the BB for this.
The eXpress train is coming - and it has more cars.

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Multipart form post

#4 Post by BruceN »

yes... we want to upload images to our own web server (running NGNIX) from our xbase program. We're using the loadfromURL() function to directly upload text now. Can't figure out how to use that fcn to upload images (jpg format).

I'll look for Jacks editor.

tnx
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Multipart form post

#5 Post by rdonnay »

You cannot upload images using LoadFromURL().

This has to be done from inside a web browser.
It requires user interaction for selecting the local file.
Is that acceptable?

You can embed a web browser in your app with DCHTMLVIEWER and then load the form into the web browser for uploading the file.

I'll work on a sample program for you if this is an acceptable method for you.
The eXpress train is coming - and it has more cars.

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: Multipart form post

#6 Post by BruceN »

I believe it will. As always... thanks.

Couldn't survive without you guys :)
There are only 10 kinds of people - those who understand binary and those who don't :)

patito
Posts: 121
Joined: Tue Aug 31, 2010 9:01 pm

Re: Multipart form post

#7 Post by patito »

Hi

Look at this link, this can help,
You can do multipart form post with class Tserverxmlhttpresquest or
activex Createobject("MSXML2.ServerXMLHTTP")

which can be downloaded from this example

Testing IPicture and TServerXMLHTTPRequest together
http://www.xbwin.com/forum.html
news.xbwin.com/ot4xb.examples

Best Regard
Hector Pezoa

Post Reply