meteor-excel icon indicating copy to clipboard operation
meteor-excel copied to clipboard

Upload excel file

Open marcojferreirac opened this issue 9 years ago • 11 comments

Is it possible to let the user upload an excel file and then use the content in my meteor app? For example, to fill textareas?

marcojferreirac avatar Jun 03 '15 15:06 marcojferreirac

Yep @marcojferreirac It is possible but may be a little hard currently. The excel package is currently available only on the server, so you would have to upload the excel file to the server, parse it with this package and then send the data to the client so that it can fill the textareas. I hope this gives you a bit of direction, if you want to be more specific in the use-case i'd be happy to help.

netanelgilad avatar Jun 09 '15 12:06 netanelgilad

hey, I set the LEADERBOARD meteorpad on, and tried to upload xslx files, parse it, and display it as a players table. none of this works - http://meteorpad.com/pad/fXayKFPQifxS85LFF/Upload%20Players%20Leaderboard

i uploaded files using cfs:gridfs, and passed the file url to the server so it workbook could read it from the url address...

what am i doing wrong?

amitrahav avatar Jun 29 '15 13:06 amitrahav

@netanelgilad i found a package to let the user upload the file. thanks for the answer!

marcojferreirac avatar Jun 30 '15 07:06 marcojferreirac

Hi, @marcojferreirac What is the name of the upload package that you used? I have similar upload/import requirement but all the data in the excel file should be parsed inside the table not textareas, I am using aldeed:tabular thru Orionjs, @netanelgilad is this possible and how do I do it?

Thanks,

Ajaxsoap avatar Aug 14 '15 20:08 Ajaxsoap

Hi, @Ajaxsoap,

i just followed an example i found on Meteortuts. Check the link below, hopefully it will help you solve your issue.

http://meteortuts.com/video/importcsvinapp

marcojferreirac avatar Aug 17 '15 11:08 marcojferreirac

Actually, I have a demo repo based on this article but with a little bit of tweaking, with the help of Ryan Glover of The Meteor Chef, but the thing is that sample demo is only working on a bare table and form, not using autoform and tabular package. Anyway, i have an idea on how to accomplish the importing, i will try to use this (meteor-excel) package if it's working. How about you, are you using any of the package that i mentioned and successfully import an excel or csv file using meteor-excel package?

Thanks!

Ajaxsoap avatar Aug 17 '15 11:08 Ajaxsoap

Actually i'm not using this package. When the file is uploaded, i save it in a collection, call the uploadFile method on the server with Meteor.call which uses fs to read the CSV file. It's not the ideal way but it works, i have it on production. i'll upload a demo of it soon.

marcojferreirac avatar Aug 17 '15 12:08 marcojferreirac

We have different approach, mine is direct importing of csv file to the client, then it will automatically save it on the collection. I think your approach is more intuitive. How do you deal with the validation? Are you using autoform or tabular on your project?

Ajaxsoap avatar Aug 17 '15 12:08 Ajaxsoap

Let me understand your use case guys so I can see if I think it should be covered by this package. You have some client page with a table or forms that you want to fill the data in from an existing excel file that the user has. Does the data need to be saved to a collection afterwards? is the import and action by itself or is it just to fill in the client side view and let the user continue from there?

I created this package mainly for manipulating excel files, and my use case was quite similar to what you can see in the MeteorPad. I'd love to accept PR and Feature Requests if you think there are things that should be added to this package.

netanelgilad avatar Sep 25 '15 09:09 netanelgilad

In my case, my PO wanted to be available to add data to the website by uploading csv files. All registered users should be available to do this.

In my website, all i have is a button to select the csv file to import. All it does is read the file, via a fs stream, save the data in the right collection and send a message to the user.

I don't know if this feature is needed in this package.

marcojferreirac avatar Sep 30 '15 16:09 marcojferreirac

yes @netanelgilad exactly, my use case is, if possible to import excel or csv file from the client then the data will store it in the collection but the problem is in collection2 schema, my collection has a lot of nested fields array of objects, i already filed an issue on collection2 here , which I think aldeed is pre-occupied with other important issues that's why until there's no reply from him.

I know that my issue is not on your package. Anyway, thank you for this package, I might use it later, once I solve the schema issue first.

Ajaxsoap avatar Oct 01 '15 05:10 Ajaxsoap