Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Conversation

@javiercn
Copy link
Member

  1. Implemented FilePathResult to efficiently return files from disk.
  2. Implemented FileStreamResult to return content from a stream.
  3. Implemented FileContentResult to return content from a byte array.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use stream's CopyToAsync?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be an option, I want to know why they didn't use it in the first place

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've investigated this and CopyTo does the same thing, so will change it.

@javiercn
Copy link
Member Author

Functional tests will be added later

@javiercn javiercn force-pushed the issue429 branch 3 times, most recently from 38968ea to 917c919 Compare September 29, 2014 23:03
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidfowl Is this the right way to get the length of a file? or should I just use FileInfo directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a file in disk for a test. I've followed a similar approach as Razor tests.

@javiercn
Copy link
Member Author

Updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also show an example where you provide the filename

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@yishaigalatzer
Copy link
Contributor

:shipit: when you get signoff from everyone else

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a space after [NotNull]. Couple of other places with the same comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stream.Null helps in case you need a stream that doesn't do anything.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var

@pranavkm
Copy link
Contributor

pranavkm commented Oct 1, 2014

:shipit: once you've addressed comments

@javiercn
Copy link
Member Author

javiercn commented Oct 1, 2014

Updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set Content-Length, or call SendAsync that will set it for you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided we don't want to set the Content-Lenght anywhere in MVC.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fail.

1) Implemented FilePathResult to efficiently return files from disk.
2) Implemented FileStreamResult to return content from a stream.
3) Implemented FileContentResult to return content from a byte array.
@javiercn javiercn merged commit a2023d3 into dev Oct 2, 2014
@javiercn javiercn deleted the issue429 branch October 3, 2014 23:43
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.

8 participants