Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Add support for multipart/form-data conversions #22

Merged
merged 5 commits into from Apr 28, 2016

Conversation

MrSaints
Copy link
Collaborator

Upload-based conversions can now be carried out by
calling a POST request on /convert using the file
parameter.

Example:

curl -F file=@index.html localhost:8080/convert

The output is a binary stream (much like the GET
endpoint).

This change significantly refactors the way a conversion
target / source is handled. When running a conversion,
we now provide an explicit conversion source. Before, we
relied on an implicit source (that we simply assumed a
Converter will handle).

The conversion source also contains the MIME type of
our conversion target. We can extend this to handle a
range of different conversions in the future.

The old util package, and its methods have been
integrated into source.go. All URLs are checked w/
cookie support.

A new CloudConvert method was also introduced for quick
upload-based conversions. In the future, it might be
worth using the inline download method only, and rely
on our own S3 uploader (that way, we won't be passing
our S3 credentials around).

TODO: refactor middleware, and application-wide config.

Upload-based conversions can now be carried out by
calling a POST request on `/convert` using the `file`
parameter.

Example:

	curl -F file=@index.html localhost:8080/convert

The output is a binary stream (much like the GET
endpoint).

This change significantly refactors the way a conversion
target / source is handled. When running a conversion,
we now provide an explicit conversion source. Before, we
relied on an implicit source (that we simply assumed a
Converter will handle).

The conversion source also contains the MIME type of
our conversion target. We can extend this to handle a
range of different conversions in the future.

The old `util` package, and its methods have been
integrated into `source.go`. All URLs are checked w/
cookie support.

A new CloudConvert method was also introduced for quick
upload-based conversions. In the future, it might be
worth using the `inline` download method only, and rely
on our own S3 uploader (that way, we won't be passing
our S3 credentials around).

TODO: refactor middleware, and application-wide config.
@MrSaints
Copy link
Collaborator Author

cc: @arachnys/qa

The tests isolated a problem in content type detection.
The read / write pointer was not reset to 0 after
creating the temporary file.
Also, set `attempts` back to 0.
It was mistakenly set to 1 during testing.
@MrSaints
Copy link
Collaborator Author

@cedric-cordenier That's a good catch. I'll bear that in mind.

@MrSaints
Copy link
Collaborator Author

Merged.

IMPORTANT:

  • If you're using / relying on Weaver's Go API, please note that it has been significantly changed in this PR;
  • If you're running into issues with the latest Docker version (which includes this PR), you can pin your Docker to use the last stable version before this (arachnysdocker/athenapdf:2.1.3 and arachnysdocker/athenapdf-service:pre-multipart)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants