سؤال

I've read Allow users upload CSV files, and embed the data for a simple API , Importing large data sets into a database over the web the closest concept is Is there a way to efficiently allow a user to upload multiple content at once for e-commerce type sites? and the most thorough A manual and automated CSV file upload solution for a website

also many of the other solutions to upload data.
What I'm thinking is to have my end users upload an Excel file to a .NET ASHX file handler that opens the file using ClosedXML and does a bulk import into a MS SQL server after doing some validation checking. Once the data is saved it is passed back to the website in a datagrid. The reason for the Excel file is that all of the users use them anyway and it a place that the data is stored locally.

Would it be better to convert the Excel data client side and send it as JSON to a WEB API as a POST? Is there a size limitation?

Is there a better way to do this? Should I consider using an FTP client in the user interface?

Thank you for your direction. I hope that this is the type of question that can be asked here.

لا يوجد حل صحيح

نصائح أخرى

I would advise to do some preprocessing and validation client-side and send a well defined document to your server. The document that is ultimately sent could be JSON or XML or even delimited plain text. This will save you the headache of dealing with garbage input from clients who forgot something or do not understand how to enter data the way you want them to. Guide them to do the right thing from your Excel macro/code-behind. So your users could still use their favorite editor (Excel) but you would provide the Excel application that has a button they can click after which their sheet is validated and only uploaded (in your favorite format) when found good. You could also split the uploads in multiple manageable documents if size is a concern.

This allows you to provide them with a dedicated data entry program later that spits out the same type of document. Your server would not have to know. Note that XML or JSON is more flexible than lines of text, providing structure and hierarchy. Making modifications and extensions later will be easier.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى softwareengineering.stackexchange
scroll top