Base solution for your next web application

Activities of "matthewosullivan"

Question

Hi

I was wondering if you have or plan on creating/publishing a product road map? It would be great to have an idea of where the project is going, especially with the imminent release of ASP.NET 5.

Also, what are your thoughts on microservice architecture in relation to ASP.NET Boilerplate, which is currently N-Layered/monolithic?

Thanks

I need to implement a custom Web API controller to use the PushStreamContent class to stream video content from server to client.

When using ABP, should we place custom Web API controllers in the Web or WebAPI layer?

Thanks for clearing that up and the example, much appreciated.

I did come across that topic but I assumed that it would be best practice/cleaner to direct everything that goes to the Application layer through an Angular service, and that when using the dynamic Web API layer it would be bad to mix and match it with MVC/Web API controllers.

I'll go with the approach you mentioned.

Out of curiosity, would it be possible to upload a file with an Angular service that's dynamically generated?

I'm using the AngularJS/EF template (which is great by the way) with the dynamic Web API layer.

I'm using the ng-file-upload directive ( [https://github.com/danialfarid/ng-file-upload]) ) and trying to send a single audio file to an ApplicationService.

Brief example <ins>Application Service</ins>

public void UploadFile(object file)

<ins>Dynamically generated Angular service</ins>

this.uploadFile = function (file, httpParams) {
	return $http(angular.extend({
		abp: true,
		url: abp.appPath + 'api/services/project/core/UploadFile',
		method: 'POST',
		data: JSON.stringify(file)
	}, httpParams));
};

<ins>Angular Controller</ins>

vm.uploadFile = function (file) {
	if (file) {
		Upload.upload({
			url: abp.appPath + 'api/services/project/core/UploadFile',
			file: file
		}).progress(function (evt) {
		    var progress = parseInt(100.0 * evt.loaded / evt.total);
			console.log('progress: ' + progress + '% ' + evt.config.file.name);
		});
	}
};

Progress is written to the console. I can see the File object in the console and it's values are set. Capturing the request in fiddler I can see: Headers: POST /api/services/project/core/UploadFile HTTP/1.1 Host: localhost:6234 Connection: keep-alive Content-Length: 9651667 Pragma: no-cache Cache-Control: no-cache Accept: application/json, text/plain, / Origin: <a class="postlink" href="http://localhost:6234">http://localhost:6234</a> User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryPcTP1YrD4qa5bhdD Referer: <a class="postlink" href="http://localhost:6234/">http://localhost:6234/</a> Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.8 Cookie: Abp.Localization.CultureName=en; ASP.NET_SessionId=1mtihmwrbienkqm2a1ad5vfd

Content-Disposition: form-data; name="file"; filename="yourself.wav" Content-Type: audio/wav

My question is what parameter type should Application layer methods expect when uploading a file using the dynamic Web API layer when we cannot get at the HttpRequest object? Is there any example of this?

Thanks.

Showing 1 to 5 of 5 entries