Click here to Skip to main content
15,891,513 members
Articles / Web Development / HTML

Discover ISAPI. Working with GET-POST Data

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
15 Jul 20024 min read 105.1K   2.5K   37  
That article present a way to retrieve the GET-POST data from a form into an ISAPI extension.
// MultipartParser.h: interface for the MultipartParser class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MULTIPARTPARSER_H__948D8A77_E5CF_11D1_A7F7_00C04FB6794C__INCLUDED_)
#define AFX_MULTIPARTPARSER_H__948D8A77_E5CF_11D1_A7F7_00C04FB6794C__INCLUDED_


#include "MultipartEntry.h"

class MultipartParser  
{
public:
	MultipartParser();
	virtual ~MultipartParser();

	virtual void			Clear();

	virtual void			SetBoundry(const char* szBound);
	virtual const char*	GetBoundry() const;

	virtual void			Reserve(unsigned long);
	virtual BOOL			Add(const PBYTE, unsigned long);
	virtual int				Parse();

	virtual int				Set(const PBYTE pBuf, int nSizeOfBuf);
	virtual void			ClearVector();

	// This will throw an out_of_range exception object if the index
	// is out of range.
	MultipartEntry*		operator[](int);

	// This will not.
	MultipartEntry*		operator[](const char*);

	virtual int				GetSize();

protected:
	virtual int				_Chunk(const PBYTE pBuf, int nSizeOfBuf, int nSlack = 0);
	MultipartVector		m_Vector;
	MultipartMap			m_Map;
	char*						m_pBound;
	int						m_nSizeOfBound;
	PBYTE						m_pBuffer;
	unsigned long			m_ulBuffer;
	unsigned long			m_ulCurrent;
	FileMap					m_FileMap;
};

#endif // !defined(AFX_MULTIPARTPARSER_H__948D8A77_E5CF_11D1_A7F7_00C04FB6794C__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


Written By
Web Developer
Romania Romania
I make programming for over 4 years and extensive experience in C++, ASP, Pascal, MFC, COM+, ATL, TCP/IP, HTTP protocols, XML, XSL, SOAP and SQL.
For the last 2 years i working extensively at the background of financial sites (databases, n tier architecture).

I’m available for contracts and/or outsourcing (<Adrian Bacaianu>adrian_bacaianu@yahoo.com).

Comments and Discussions