Student project by David Berlin and Boris Dogadov made for the Embedded Systems Workshop course given in Tel-Aviv University on 2010 by Sivan Toledo. Visit the project website for more details: http://davidberlin.co.il/sadna/ .

Dependencies:   EthernetNetIf NTPClient_NetServices mbed HTTPServer HTTPClient CyaSSL

Revision:
0:3e7d6f496a67
Child:
1:b05231650f32
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dropbox/HTTPFileSender.h	Sun Apr 17 21:30:10 2011 +0000
@@ -0,0 +1,34 @@
+#include "HTTPData.h"
+//#include "HTTPText.h"
+#include "HTTPClient.h"
+
+class HTTPFileSender : public HTTPData
+{
+ public:
+  HTTPFileSender(const char *fileName, const char* dstFile);  
+  virtual ~HTTPFileSender();
+  virtual void clear();
+  virtual int read(char* buf, int len);
+  virtual int write(const char* buf, int len);
+  
+  virtual string getDataType(); //Internet media type for Content-Type header
+  virtual void setDataType(const string& type); //Internet media type from Content-Type header
+  
+  virtual bool getIsChunked(); //For Transfer-Encoding header
+  virtual void setIsChunked(bool chunked); //From Transfer-Encoding header
+  
+  virtual int getDataLen(); //For Content-Length header
+  virtual void setDataLen(int len); //From Content-Length header, or if the transfer is chunked, next chunk length
+ private:
+    FILE *file; 
+    
+    int pos;
+    int totalLen;
+    int fileLen;
+    
+    int headerSize;
+    int footerSize;
+    
+    static char header[256];
+    static char footer[128];
+};
\ No newline at end of file