Comments (6)
In addition to libcurl (an example of using libcurl to perform non-blocking
multipart
upload can be found here: http://curl.haxx.se/libcurl/c/multi-post.html ) I've
attached an example to illustrate how multipart encoding works, in case it
needs to
be implemented directly.
In the attached zip, there are two files:
upload_test.html - A simple HTML form containing a file upload field. There are
also text fields for a description and comments.
multipart_form_data.txt - This is the full HTTP request that is sent from the
browser to the web server when you click the submit button in the above form.
In
this case, the file that I selected to upload was the same HTML file
(upload_test.html).
Note the following details pertaining to multipart form data:
- The content type is multipart/form-data, rather than
application/x-www-form-urlencoded.
- You must select a "boundary" string. This string must not occur anywhere in
the
file you are sending. The boundary is specified as part of the Content-Type
header.
- The boundary used in this example is
"----WebKitFormBoundaryLbY6AhAtDH+gKEMT". It
is not strictly necessary for this to start with hyphens; any string will do.
Note,
however, that wherever it is used, there are two additional hyphens at the
beginning.
That is because the section start indicator consists of two hyphens followed by the
boundary string. For example, if the boundary string is "MyBoundary", then you
start
a section with "--MyBoundary". Note also that the end marker would be
"--MyBoundary--" in that case (i.e. add two hyphens to both the beginning and
end of
the boundary string).
- The section markers need to start at the beginning of a line. So even if the
file
you're sending is binary, you need to add an end-of-line sequence at the end,
before
the section marker. My example file ends with a newline, but you'll note that
an
extra end-of-line sequence was added, resulting in a blank line before the
section
marker.
- End-of-line sequences should be CR LF in compliance with RFC 2616. (But this
doesn't mean changing bare LF characters to CR LF sequences in the uploaded
file's
contents.)
- You don't need to escape the file's contents in any way. The file is assumed
to
start after the first blank line in its section, and it ends when the boundary
string
(preceded by two hyphens) is encountered.
Original comment by [email protected]
on 24 Nov 2009 at 3:32
- Added labels: ****
- Removed labels: ****
Attachments:
from crashrpt.
1) The fragment from CrashRpt documentation:
"The script should return status of request completion as server responce
content. In
HTTP/1.0 and since, the first line of the HTTP response is called the status
line and
includes a numeric status code (such as "404") and a textual reason phrase
(such as
"Not Found").
If the script succeeds in saving the error report, it should return the "200
Success"
as server responce content. If the script encounters an error, it should return
a 4xx
error code, for example "450 Invalid parameter". Note that some error codes are
reserved by HTTP specification. If the script uses custom error codes, they
shouldn't
intersect with standard predefined HTTP codes.
Note: When creating your own script, be careful with the script's return code.
If
your script succeeds in saving error report it should return '200 Success'. If
crash
sending process encounters another error code, it attempts sending the error
report
using another way. In such situation you may receive the same error report
several
times through different transport."
2) I will investigate if we can use libcurl. This may be useful.
Original comment by [email protected]
on 24 Nov 2009 at 2:44
- Added labels: ****
- Removed labels: ****
from crashrpt.
Thank you for the information about the server response.
Please do investigate libcurl, it is an extremely useful library.
Original comment by [email protected]
on 25 Nov 2009 at 1:24
- Added labels: ****
- Removed labels: ****
from crashrpt.
I've introduced myself with libcurl. As I understand, libcurl allows to post
HTTP
requests splitting them into many small parts. This is useful when sending huge
files.
I think this feature is very useful, even if you plan to implement the support
of
huge dumps. Our current delivery transport (usual HTTP and e-mail) are not
designed
to transfer large files.
Related to feature implementation. Since libcurl distrib is rather large (3.5
Mb), we
can't include its code in CrashRpt download. We will provide a link to the
libcurl
download page, so user will be able to download it by himself.
I think libcurl usage should be optional. We shouldn't require user to have
libcurl
installed to compile CrashRpt. We should introduce some compilation switch
macro, for
example _USE_LIBCURL to allow user to enable libcurl support.
Original comment by [email protected]
on 27 Nov 2009 at 1:01
- Changed title: Multi-part crash reports delivery with libcurl
- Changed state: Accepted
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
from crashrpt.
After some additional research, I think that multi-part uploads can be
implemented
using usual HttpSendRequestEx() and InternetWriteFile() functions provided by
WinInet. Multipart file uploads are part of HTTP specification and regular
WinInet
functions work well enough to handle this task.
It seem that libcurl in not required at all. libcurl seems to be a
multi-platform
replacement of some subset of WinInet functionality.
Original comment by [email protected]
on 14 Jan 2010 at 8:57
- Added labels: Priority-High
- Removed labels: Priority-Medium
from crashrpt.
Implemented in v.1.2.2
Original comment by [email protected]
on 23 Mar 2010 at 5:34
- Changed state: Fixed
- Added labels: ****
- Removed labels: ****
from crashrpt.
Related Issues (20)
- Remove VS2005/ATL Compatibility HOT 2
- CrashRpt is not capturing Exact exception information some times. its crashed at crashHandler HOT 1
- Crashrpt not able to handle the Exceptions from ActiveX Controller call back in MFC . HOT 2
- can't make the crashreporter installed HOT 2
- No minidump created sometimes - reports "Only part of a ReadProcessMemory or WriteProcessMemory request was completed" HOT 1
- [deleted issue]
- Capture only windows belonging to the process HOT 1
- Czech localization HOT 2
- Potential crash in CrashSender.exe HOT 1
- uiAccess=true elevated process cannot create minidump HOT 1
- not compilable under Visual Studio 2013 HOT 5
- Include Polish translation (attached) HOT 1
- Redirects to a different server are not handled HOT 1
- If the crashsender is redirected, the crash report upload may happen twice.
- CrashCallback not working in VS 2013 HOT 3
- CrashSender crashes with access violation
- Can't make CrashRpt work with Qt HOT 1
- Translation files
- Setting bContinueExecution generates report twice
- can't open the crashfix server website HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crashrpt.