Base solution for your next web application

Activities of "joshyates"

It was not in the dist folder, so I manually added it.

Answer

Yes, I looked at the code for saving images in the database, but I was going to go with a file system for now. I want my client to be able to upload multiple files at once and use blueimp jquery upload. I'll save the files here:

private void SetAppFolders()
{
      var appFolders = IocManager.Resolve<AppFolders>();

      appFolders.SampleProfileImagesFolder = Path.Combine(_env.WebRootPath, @"Common\Images\SampleProfilePics");
      appFolders.TempPath = Path.Combine(_env.WebRootPath, @"Temp");
      appFolders.TempFileDownloadFolder = Path.Combine(_env.WebRootPath, @"Temp\Downloads");
      appFolders.WebLogsFolder = Path.Combine(_env.ContentRootPath, @"App_Data\Logs");
      appFolders.UploadImages = Path.Combine(_env.WebRootPath, @"Common\Upload");
      appFolders.Thumbs = Path.Combine(_env.WebRootPath, @"Common\Upload\Thumbs");

I opened the NuGet Package manager and updated everything. That cleaned up almost all the errors. The only one I had to manual fix was: jquery.sparkline.js

v2.1.2 <a class="postlink" href="http://omnipotent.net/jquery.sparkline/">http://omnipotent.net/jquery.sparkline/</a>

Answer

My major concern is database schema changes after my aspnetzero project is in production. Anybody with experience please advice.

Thanks.

Answer

I'm taking small steps with my file upload functionality in my aspnetzero project and would like your opinion/advice.

My current functionality: User can upload multiple files.

Currently developing: create guid for each file uploaded. save image attributes to database. create image grouping for gallery.

Future development: save images in Azure storage

Where do you recommend I save uploaded images within the folder structure? I want to use the private method already created:

private void SetAppFolders()
        {
            var appFolders = IocManager.Resolve<AppFolders>();

Should I save the images in:

Web.Mvc project contains the presentation/API layer (Controllers, Views, javascripts, styles, images and so on) for backend and frontend applications.

or

Web.Host project does not contain any view/css/js files. Instead, it just serves the application as remote API. So, any device can consume your application as API.

Thank you.

  • Josh
Answer

I'm currently implementing Blueimp file upload into my aspnetzero example solution.

Once completed, I'll fork.

This is MVC5, but works very nice for multiple upload and gallery:

<a class="postlink" href="https://github.com/CodeHeight/jQuery-File-Upload.MVC5">https://github.com/CodeHeight/jQuery-File-Upload.MVC5</a>

Check out that attachment...upside down image. :lol:

1 - Yes, "ListResultOutput" has removed: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1402">https://github.com/aspnetboilerplate/as ... ssues/1402</a>

What I have been doing is coming to this forum and using the search textbox. That's how I found the solution for "ListResultOutput".

2- Compare with Githubs source code. Do it manually. The tutorial is a little out of date, but it still is a good way of learning the platform with simple examples.

Answer

Logs from azure server:

ERROR 2016-10-21 12:42:21,610 [28   ] e.Diagnostics.ExceptionHandlerMiddleware - An unhandled exception has occurred: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
System.Security.Cryptography.CryptographicException: The data protection operation was unsuccessful. This may have been caused by not having the user profile loaded for the current thread's user context, which may be the case when the thread is impersonating.
   at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
   at System.Security.Cryptography.DpapiDataProtector.ProviderProtect(Byte[] userData)
   at Microsoft.AspNet.SignalR.Infrastructure.DataProtectionProviderProtectedData.Protect(String data, String purpose)
   at Microsoft.AspNet.SignalR.PersistentConnection.ProcessNegotiationRequest(HostContext context)
   at Microsoft.AspNet.SignalR.PersistentConnection.ProcessRequest(HostContext context)
   at Microsoft.Owin.Mapping.MapMiddleware.<Invoke>d__0.MoveNext()
Answer

Should the url be my server url? <a class="postlink" href="http://www.website.com:80/signalr/">http://www.website.com:80/signalr/</a> instead of <a class="postlink" href="http://website:80/signalr/">http://website:80/signalr/</a>

I took a screenshot of my trace in my Azure environment:

Showing 1 to 10 of 14 entries