Hi folks. Original post erased, reworked in this message. I''m trying to use a form submit, using AJAX, to submit a file. I will go through stuff.js which has a function that grabs the file submission: $(''item5'') Is this doable? Can I then turn around and submit this into an ajax.updater in order that my middleware can process it in file_uploads (the regular way I do it) without refreshing a form? Is there a way to submit files without refreshing a form? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Realized this cannot be done. On Jul 8, 11:34 am, BeeRich <beer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi folks. Original post erased, reworked in this message. > > I''m trying to use a form submit, using AJAX, to submit a file. > > I will go through stuff.js which has a function that grabs the file > submission: > > $(''item5'') > > Is this doable? Can I then turn around and submit this into an > ajax.updater in order that my middleware can process it in > file_uploads (the regular way I do it) without refreshing a form? > > Is there a way to submit files without refreshing a form?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Nope, don''t think you can grab files and upload them via javascript. Check out some Flash plugins for this. Reason is security I believe, imagine javascript grabbing c:/turbotax_return or something. I actually remember when Yahoo released their javascript library the Ajax style form submit had a comment in the code about this very issue. On Jul 8, 8:34 am, BeeRich <beer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi folks. Original post erased, reworked in this message. > > I''m trying to use a form submit, using AJAX, to submit a file. > > I will go through stuff.js which has a function that grabs the file > submission: > > $(''item5'') > > Is this doable? Can I then turn around and submit this into an > ajax.updater in order that my middleware can process it in > file_uploads (the regular way I do it) without refreshing a form? > > Is there a way to submit files without refreshing a form?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
"Death before Flash". Nuff said. I found a solution, however some functions with Prototype aren''t working for some reason. I started another post about that. element.update has no properties...which is strange. It''s an empty element, and it''s definitely there. My research today said something about opening up the DOM security, which is possible, but not recommended at any level. So, the non-refresh gets taken care of by iFrame, and the load of the iFrame launches an event.observer target function that should do what I want. 95% of it works. The observe works, calls the function, but for some reason, my target div doesn''t have any properties. Like it''s not there. Very very strange. Cheers On 7/9/07, jwmeigs <tippingpints-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Nope, don''t think you can grab files and upload them via javascript. > Check out some Flash plugins for this. Reason is security I believe, > imagine javascript grabbing c:/turbotax_return or something. > > I actually remember when Yahoo released their javascript library the > Ajax style form submit had a comment in the code about this very > issue. > > On Jul 8, 8:34 am, BeeRich <beer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hi folks. Original post erased, reworked in this message. > > > > I''m trying to use a form submit, using AJAX, to submit a file. > > > > I will go through stuff.js which has a function that grabs the file > > submission: > > > > $(''item5'') > > > > Is this doable? Can I then turn around and submit this into an > > ajax.updater in order that my middleware can process it in > > file_uploads (the regular way I do it) without refreshing a form? > > > > Is there a way to submit files without refreshing a form? > > > > >-- BeeRich, Toronto --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 09 Jul 2007, at 07:13, BeeRich wrote:> "Death before Flash". Nuff said. > > I found a solution, however some functions with Prototype aren''t > working for some reason. I started another post about that. > element.update has no properties...which is strange. It''s an empty > element, and it''s definitely there. > > My research today said something about opening up the DOM security, > which is possible, but not recommended at any level. So, the > non-refresh gets taken care of by iFrame, and the load of the iFrame > launches an event.observer target function that should do what I want. > > 95% of it works. The observe works, calls the function, but for some > reason, my target div doesn''t have any properties. Like it''s not > there. Very very strange.Although I''m not a very big Flash fan myself, I don''t refrain from using the best solution for a certain problem. For emulating ajax uploads Flash has some serious advantages over an iFrame for example. I''m using SWFUpload in several of our applications with great success. IMHO, the biggest advantage of using a very small Flash movie just for the upload (so not for anything interface related) is that Flash enables you to do client-side checking before uploading the file: maximum filesize, allowed file extensions (greying out unavailable files in the selection dialog), multiple file selection in the selection dialog, reliable upload progress without hammering the server every few seconds ... The serverside checks should still be in place, because you should never trust a user (but in Rails using attachment_fu for example that''s just so easy), but at least normal use of your application will limit the options presented BEFORE the file is uploaded, very useful when some users upload movies > 40 MB using their capped upload internet connection at home. Not trying to convert you to a Flash based solution here, but just pointing out some of the upsides of such a solution to other readers on the list. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 9, 3:49 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> Although I''m not a very big Flash fan myself, I don''t refrain from > using the best solution for a certain problem. > > For emulating ajax uploads Flash has some serious advantages over an > iFrame for example. I''m using SWFUpload in several of our > applications with great success.Sure. But taking weeks out to introduce a new technology, to the point I''m comfortable about implementing it in a solution, is not anywhere near what I''m willing to do. File uploads with a refresh is a mere 30 minutes away, if I decide to go there. When I''m trying to run a business, the business comes first. It makes perfect sense. So in that respect, Flash, has lost out multiple times, will lose out multiple times, because I refuse to learn a new technology, and continue to keep up on a completely new technology. And no, I won''t take even a day to implement that. I have more than enough projects to get into.> IMHO, the biggest advantage of using a very small Flash movie just > for the upload (so not for anything interface related) is that Flash > enables you to do client-side checking before uploading the file: > maximum filesize, allowed file extensions (greying out unavailable > files in the selection dialog), multiple file selection in the > selection dialog, reliable upload progress without hammering the > server every few seconds ...Believe me, if the user can''t upload the right files, or choose the right types, then they shouldn''t be on my site.> The serverside checks should still be in place, because you should > never trust a user (but in Rails using attachment_fu for example > that''s just so easy), but at least normal use of your application > will limit the options presented BEFORE the file is uploaded, very > useful when some users upload movies > 40 MB using their capped > upload internet connection at home. > > Not trying to convert you to a Flash based solution here, but just > pointing out some of the upsides of such a solution to other readers > on the list.And I would also point out that you are only expected to go so far. There is some responsibility on the part of the user. I don''t spell check their text submissions, nor do I check the alignment or exposure of thier photos either. Again, this is something that I expected to have working yesterday. It''s a single piece of a project that I don''t intend to investigate for weeks. If anybody has that amount of time kicking around (even more than 1 day), then their time management is a bit questionable. And, considering that other solutions are very close to what I currently have, it''s just a matter of time before I can get it done. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 9.7.2007, at 11.26, BeeRich wrote:> And I would also point out that you are only expected to go so far. > There is some responsibility on the part of the user. I don''t spell > check their text submissions, nor do I check the alignment or exposure > of thier photos either. Again, this is something that I expected to > have working yesterday. It''s a single piece of a project that I don''t > intend to investigate for weeks. If anybody has that amount of time > kicking around (even more than 1 day), then their time management is a > bit questionable. And, considering that other solutions are very > close to what I currently have, it''s just a matter of time before I > can get it done.Cheer up, mate. If your time is so valuable, I don''t think it''s worth spending too much of it flaming people who are trying to help you and others. You might be too busy to apply a new technology right now, but never spending a day or two to learn new things is bound to shorten your career quite a bit, considering the speed at which things are evolving in our field. Also, I''m sure hackers will appreciate your attitude of putting as much responsibility as possible on the user. Like Peter said, you might take a big hit on the server if people try to upload too big files, keeping a server process or thread busy during the whole upload time before you can do anything about it. I''ve never done it but I wouldn''t think starting to use an uploader such as http://swfupload.mammon.se/ would take too much time. Cheers, //jarkko -- Jarkko Laine http://jlaine.net http://dotherightthing.com http://www.railsecommerce.com http://odesign.fi
On Jul 9, 5:32 am, Jarkko Laine <jar...-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org> wrote:> Cheer up, mate. If your time is so valuable, I don''t think it''s worth > spending too much of it flaming people who are trying to help you and > others. You might be too busy to apply a new technology right now, > but never spending a day or two to learn new things is bound to > shorten your career quite a bit, considering the speed at which > things are evolving in our field.I would think everybody''s time is valuable. Second, I''m not flaming anybody. Third, spending a day or two to support something as different as Flash, is simply building a house of cards. This is a regular topic that comes up, and people easily adopt third party solutions without knowing how to service the chunks of code that they put into their systems. Once they realize it''s close, but has issues in their application, they have gone live and realize their app has a major hole in it, of which they have little skill to fix, without hiring someone to do it for them.> Also, I''m sure hackers will appreciate your attitude of putting as > much responsibility as possible on the user. Like Peter said, you > might take a big hit on the server if people try to upload too big > files, keeping a server process or thread busy during the whole > upload time before you can do anything about it.Try filtering the div upon submit. Second, you also assume my application is open to spammers. You never thought this might be in a business application on an intranet?> I''ve never done it but I wouldn''t think starting to use an uploader > such ashttp://swfupload.mammon.se/would take too much time.You just mentioned exactly what I see happen on regular occasions. People adopting pieces of code outside of their knowledge in order to fill a need in their app. If it fails, you rely on that person''s limited website, and their ability to respond to their email.>From a business perspective, that is a huge risk. Massive. You arebuilding a house of cards that is just poised to fail, without taking the time to investigate fully, the ramifications of it either not fully accomplishing what you need, or it breaking. Second, if they were so popular and it was that easy to accomplish where the responsible developer was fully content, how come we don''t see this much more regularly? So I go back to my original comment. It''s a huge mistake to do that, without the investment of time to properly address the needs of the code. You want to slap together third party solutions based upon people mentioning stuff in blogs? Go right ahead. The main reason I''m in here to begin with is because a 1.5.1.1 version of one of the first AJAX libraries, isn''t behaving the way it should. And I''ve asked other developers to review the code, and they are equally as stumped. If something as pervasive as Prototype can show issues like this, I certainly don''t want to rely on some kid''s Flash. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 09 Jul 2007, at 11:32, Jarkko Laine wrote:> Cheer up, mate. If your time is so valuable, I don''t think it''s > worth spending too much of it flaming people who are trying to help > you and others. You might be too busy to apply a new technology > right now, but never spending a day or two to learn new things is > bound to shorten your career quite a bit, considering the speed at > which things are evolving in our field. > > Also, I''m sure hackers will appreciate your attitude of putting as > much responsibility as possible on the user. Like Peter said, you > might take a big hit on the server if people try to upload too big > files, keeping a server process or thread busy during the whole > upload time before you can do anything about it.Hackers are the least of my worries (they can still stream a huge file to my upload method if they want), I''m using SWFUpload in both intranet and public applications because you always have users that are not as smart as they pretend to be.> I''ve never done it but I wouldn''t think starting to use an uploader > such as http://swfupload.mammon.se/ would take too much time.I''ve implemented it in my solution in less than 30 minutes, the documentation couldn''t be simpler. I''ve tried some other options too (respond_to_parent amongst others) and they took a lot longer to implement and didn''t yield the result I was looking for. I''m using Flash in two areas, both scripts gracefully degrade if Flash or JS is not enabled: SWFUpload and sIFR. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On 9.7.2007, at 12.44, BeeRich wrote:> On Jul 9, 5:32 am, Jarkko Laine <jar...-k1O+Gnc6WpmsTnJN9+BGXg@public.gmane.org> wrote: > >> Cheer up, mate. If your time is so valuable, I don''t think it''s worth >> spending too much of it flaming people who are trying to help you and >> others. You might be too busy to apply a new technology right now, >> but never spending a day or two to learn new things is bound to >> shorten your career quite a bit, considering the speed at which >> things are evolving in our field. > > I would think everybody''s time is valuable. Second, I''m not flaming > anybody.Well, I guess that''s debatable but you did spend a whole lot of lines ranting about Peter''s mail even though he explicitly stated he was "Not trying to convert you to a Flash based solution here, but just pointing out some of the upsides of such a solution to other readers on the list." Aside of that, you said: "If anybody has that amount of time kicking around (even more than 1 day), then their time management is a bit questionable." That might sound a bit insulting to people trying to find the best solution to their problems and to keep on the nerve of things.> Third, spending a day or two to support something as > different as Flash, is simply building a house of cards. This is a > regular topic that comes up, and people easily adopt third party > solutions without knowing how to service the chunks of code that > they put into their systems. Once they realize it''s close, but has > issues in their application, they have gone live and realize their app > has a major hole in it, of which they have little skill to fix, > without hiring someone to do it for them.I was talking about learning and exploring, not implementing something head first.> >> Also, I''m sure hackers will appreciate your attitude of putting as >> much responsibility as possible on the user. Like Peter said, you >> might take a big hit on the server if people try to upload too big >> files, keeping a server process or thread busy during the whole >> upload time before you can do anything about it. > > Try filtering the div upon submit. Second, you also assume my > application is open to spammers. You never thought this might be in a > business application on an intranet?OK, I was a bit off there. However, I was not talking about your specific application but trying to point out there is a huge difference between checking the file size on the client vs the server side. Whether it''s hackers or stupid users is not the point. I fully understand a Flash uploader might not be feasible in your current project (or any of them). But responding in a very negative tone (you might not have meant that, it''s just how it got out to me) to a post where a fellow community member tries to help you and other members isn''t very productive in my book. Cheers, //jarkko -- Jarkko Laine http://jlaine.net http://dotherightthing.com http://www.railsecommerce.com http://odesign.fi
On 09 Jul 2007, at 11:44, BeeRich wrote:>> Cheer up, mate. If your time is so valuable, I don''t think it''s worth >> spending too much of it flaming people who are trying to help you and >> others. You might be too busy to apply a new technology right now, >> but never spending a day or two to learn new things is bound to >> shorten your career quite a bit, considering the speed at which >> things are evolving in our field. > > I would think everybody''s time is valuable. Second, I''m not flaming > anybody. Third, spending a day or two to support something as > different as Flash, is simply building a house of cards. This is a > regular topic that comes up, and people easily adopt third party > solutions without knowing how to service the chunks of code that > they put into their systems. Once they realize it''s close, but has > issues in their application, they have gone live and realize their app > has a major hole in it, of which they have little skill to fix, > without hiring someone to do it for them.First of all, you contradict yourself in just about everything you say. Second, your tone sounds agressive and flaming, even if not intented as such. Third, it''s not because you use open source components like RoR, SWFUpload or whatever''s out there, you don''t know what''s going on behind the scenes and should a bug come up, I''m sure I''m able to fix it. The whole point about using stuff that''s out there (and preferrably open source) is time management, I don''t want to invent the wheel if I don''t have to and if I''m able to do so, I contribute to an open source project instead of flaming everyone involved.>> Also, I''m sure hackers will appreciate your attitude of putting as >> much responsibility as possible on the user. Like Peter said, you >> might take a big hit on the server if people try to upload too big >> files, keeping a server process or thread busy during the whole >> upload time before you can do anything about it. > Try filtering the div upon submit. Second, you also assume my > application is open to spammers. You never thought this might be in a > business application on an intranet?Sure, and all the users on your intranet are geniuses. Never assume that your user is as smart as you think he is.>> I''ve never done it but I wouldn''t think starting to use an uploader >> such ashttp://swfupload.mammon.se/would take too much time. > > You just mentioned exactly what I see happen on regular occasions. > People adopting pieces of code outside of their knowledge in order to > fill a need in their app. If it fails, you rely on that person''s > limited website, and their ability to respond to their email.Three remarks about this: 1) I looked into the SWFUpload code and changed some stuff to my liking to better integrate it with Rails (so guess what, I do understand what''s going on). Open source means you have full access to the code. 2) I e-mailed the SWFUpload developer with some of the changes I made, he incorporated them together with a slew of new features a few weeks later. Those new features came in very handy btw, and guess what, I didn''t spend any time implementing them and our application improved, if that''s not good time management. 3) You''re posting this on the Prototype/scriptaculous list, so I''m assuming you''re using the libraries in your application. Seems you''re using someone else''s code, doesn''t it? Maybe you should write a completely new javascript parser and while you''re at it, a new browser and rendering engine, because you don''t know the code that''s in Firefox/Safari and everyone knows there are quite a few bugs in every browser.>> From a business perspective, that is a huge risk. Massive. You are >> building a house of cards that is just poised to fail, without taking >> the time to investigate fully, the ramifications of it either not >> fully accomplishing what you need, or it breaking. Second, if they >> were so popular and it was that easy to accomplish where the >> responsible developer was fully content, how come we don''t see this >> much more regularly? > > So I go back to my original comment. It''s a huge mistake to do that, > without the investment of time to properly address the needs of the > code. You want to slap together third party solutions based upon > people mentioning stuff in blogs? Go right ahead. The main reason > I''m in here to begin with is because a 1.5.1.1 version of one of the > first AJAX libraries, isn''t behaving the way it should. And I''ve > asked other developers to review the code, and they are equally as > stumped. If something as pervasive as Prototype can show issues like > this, I certainly don''t want to rely on some kid''s Flash.There are two ways to deal with bugs in an open source framework or module: complain and wine about it, intentionally or unintentionally being very disrespectful towards the people who have invested a lot of their precious time in writing the code you''re using for free or deal with it, find the bug that''s blocking you and fix it, making the framework better for everyone. The other option would be to write your own bugfree javascript library, everyone by now must have realized that your code must be unbelievably good and you know all the quirks of all flavors of web browsers out there. I know one thing: this kid has actually produced a solution to a problem that works (our thousands of users can testify that), has published it for everyone to use and doesn''t have an attitude like yourself. A large part of computer industry is based on the creativity and work of "children" as you like to call them btw. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 9, 7:42 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> Three remarks about this: > 1) I looked into the SWFUpload code and changed some stuff to my > liking to better integrate it with Rails (so guess what, I do > understand what''s going on). Open source means you have full access > to the code.Wonderful. YOU know what that code is. For me to adopt Flash I''d have to take the time I mentioned. I''ve never said otherwise about open source. As open as it can be, it''s still new to many people. Simply jumping into new technologies doesn''t mean it''s a strong strategy.> 2) I e-mailed the SWFUpload developer with some of the changes I > made, he incorporated them together with a slew of new features a few > weeks later. Those new features came in very handy btw, and guess > what, I didn''t spend any time implementing them and our application > improved, if that''s not good time management.1. Having a single developer reply to emails is not what most people would consider tech support. JQuery and Prototype now have teams of developers, and for very good reason. 2. Good time management? Weeks later?> 3) You''re posting this on the Prototype/scriptaculous list, so I''m > assuming you''re using the libraries in your application. Seems you''re > using someone else''s code, doesn''t it?You do every time you sit at a computer. But if you don''t see the difference between adopting Prototype and some guy''s code posted on his website back in 1999, then you should look again. Many organizations, big and small, question the ability to maintain code that''s current, tested with other migrating technologies, and supported fully. With all the JS libs out there, it''s one of the things Prototype has going for itself.> Maybe you should write a completely new javascript parser and while > you''re at it, a new browser and rendering engine, because you don''t > know the code that''s in Firefox/Safari and everyone knows there are > quite a few bugs in every browser.You wouldn''t do well in any management position, at least for a company that needs responsible people.> There are two ways to deal with bugs in an open source framework or > module: complain and wine about it, intentionally or unintentionally > being very disrespectful towards the people who have invested a lot > of their precious time in writing the code you''re using for free or > deal with it, find the bug that''s blocking you and fix it, making the > framework better for everyone. The other option would be to write > your own bugfree javascript library, everyone by now must have > realized that your code must be unbelievably good and you know all > the quirks of all flavors of web browsers out there.Wow. How wrong you are. I''m not whining about it, I brought it to attention. My complaint was that there was a solution brought up that makes little or no sense. If you still can''t get that, reread the thread. I appreciate the code I use, and continue to use it. But if you think everybody using Prototype is going to learn Javascript to the extent the authors know it, you are just plain wrong. That''s why it''s used to begin with. Otherwise, we''d roll it ourselves. So as a recap, I''m not only pointing out the roadblock that I''ve hit (for any reason) and I''d like to get around it. But I''m not learning how to build a rocket, take up electrical engineering, or learning 3 new computer languages. There are solutions close to what I would like to do, and I''ve posted in here to see if I''ve missed something. THAT is what I''m doing to solve the issue. I guess you missed that part.> I know one thing: this kid has actually produced a solution to a > problem that works (our thousands of users can testify that), has > published it for everyone to use and doesn''t have an attitude like > yourself. A large part of computer industry is based on the > creativity and work of "children" as you like to call them btw.Attitude? Having a business perspective is completely justified. I guess you''re a hobbyist. Well, when you get into business, you''ll see how numbers work and how they have to be represented by smart time management, while not creating a potential disaster. And as for your concept of tech support, just because it''s worked in the past doesn''t mean it''s going to work in the future. Some items in Prototype alone have changed amongst versions. So I guess simply updating that lib might break your apps, but you still feel completely justified. Children are still managed professionally by managers. I suggest you take a look at some of the professional articles that come out on crisis management, and crisis avoidance. While adopting loose third party random post software is quite doable, you could really be creating a big problem for yourself if you don''t understand the underlying code. That, is not attitude, that is just common sense. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
>> Third, spending a day or two to support something as >> different as Flash, is simply building a house of cards. This is a >> regular topic that comes up, and people easily adopt third party >> solutions without knowing how to service the chunks of code that >> they put into their systems. Once they realize it''s close, but has >> issues in their application, they have gone live and realize their >> app >> has a major hole in it, of which they have little skill to fix, >> without hiring someone to do it for them.First of all, the ActionScript code from SWFUpload is just dead simple, even if you don''t know jack about flash, you could understand it and see that there''s little room for error. The SWFUpload "kid" has just come up with the idea of wrapping it in a simple piece of code, just like the other "ajax upload" scripts are very simple in nature, but the result of a "eureka" moment. And if at some point SWFUpload would not be sufficient for my needs, I can do something that''s called refactoring, maybe you should look it up. My code is clean enough so that I can take out the SWFUpload code and replace it with something else if a better solution would pop up, I wouldn''t have to change on single line of code in my upload script. What these AJAX upload scripts do, is essentially exactly the same thing as you would get with a normal <input type="file"> field, i.e. streaming a file to a method on your server. I might be getting the wrong impression here, but you''re making it sound as if outsourcing is a bad thing. In a real business, outsourcing can be a great thing if the cost of the outsourcing is lower than the cost of your own time. One can not know everything that''s out there and be great at it.> I was talking about learning and exploring, not implementing > something head first.Exactly, I spend a fair amount of my free time reading RSS feeds to be in the loop on what''s out there. I like to spend my evenings experimenting and trying to see if a solution would be feasible for the projects I''m working on within my company. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Jul 9, 8:08 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> First of all, the ActionScript code from SWFUpload is just dead > simple, even if you don''t know jack about flash, you could understand > it and see that there''s little room for error. The SWFUpload "kid" > has just come up with the idea of wrapping it in a simple piece of > code, just like the other "ajax upload" scripts are very simple in > nature, but the result of a "eureka" moment. > > And if at some point SWFUpload would not be sufficient for my needs, > I can do something that''s called refactoring, maybe you should look > it up. My code is clean enough so that I can take out the SWFUpload > code and replace it with something else if a better solution would > pop up, I wouldn''t have to change on single line of code in my upload > script. What these AJAX upload scripts do, is essentially exactly the > same thing as you would get with a normal <input type="file"> field, > i.e. streaming a file to a method on your server. > > I might be getting the wrong impression here, but you''re making it > sound as if outsourcing is a bad thing. In a real business, > outsourcing can be a great thing if the cost of the outsourcing is > lower than the cost of your own time. One can not know everything > that''s out there and be great at it.You are getting the wrong message then. Outsourced is one thing, shareware/freeware code is another. But referring to your outsourcing reference, there are a lot of Indian code factories that cannot offer half of what a domestic, on-site developer can offer. With respect to being great, it has to have some serious backing before loads of organizations would adopt published code.> > I was talking about learning and exploring, not implementing > > something head first. > > Exactly, I spend a fair amount of my free time reading RSS feeds to > be in the loop on what''s out there. I like to spend my evenings > experimenting and trying to see if a solution would be feasible for > the projects I''m working on within my company.As do I. If anything, the majority of it is to see what is possible, what can be done, and most importantly, to give me the knowledge to be able to learn the code behind the features it brings, not to simply give me ways to copy someone else''s recipe for a soup I want. I love expanding what I''m doing, but not to the point my apps are questionable down the road, and dependent upon single author''s websites that can disappear overnight. I don''t expect that to happen to any of the tools I use, and that too is a crapshoot. And I don''t like Flash. Heh. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I have used a hidden iframe for asynchronous file uploads and its worked out very well for me. You''ve got to set up the form separate of other elements so it can use its submit event, that is essential, also make sure you have enctype="multipart/form-data" in the form tag. Next set the target to the name of your iframe, i usually double name and id so the form and my JS components reference the same value. You''ll have the make sure that the target of your form''s post is to the server side script you want to accept the file. The server side script needs to do the action of file upload but also notify the user that they have successfully uploaded their image and it is now available for use, this is where it gets kind of tricky. You''ll have to output some HTML that will use javascript to reference its parent window and then call a function and sending it a string or the file name. <script type=''text/javascript''>window.parent.fileUploaded("<?$_FILES[''myfile''][''name'']?>")</script> Its pretty verbose but it will work, it avoids security restrictions, and allows for smooth asynchronous interface. On Jul 9, 8:40 am, BeeRich <beer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Jul 9, 8:08 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote: > > > > > First of all, the ActionScript code from SWFUpload is just dead > > simple, even if you don''t know jack about flash, you could understand > > it and see that there''s little room for error. The SWFUpload "kid" > > has just come up with the idea of wrapping it in a simple piece of > > code, just like the other "ajax upload" scripts are very simple in > > nature, but the result of a "eureka" moment. > > > And if at some point SWFUpload would not be sufficient for my needs, > > I can do something that''s called refactoring, maybe you should look > > it up. My code is clean enough so that I can take out the SWFUpload > > code and replace it with something else if a better solution would > > pop up, I wouldn''t have to change on single line of code in my upload > > script. What these AJAX upload scripts do, is essentially exactly the > > same thing as you would get with a normal <input type="file"> field, > > i.e. streaming a file to a method on your server. > > > I might be getting the wrong impression here, but you''re making it > > sound as if outsourcing is a bad thing. In a real business, > > outsourcing can be a great thing if the cost of the outsourcing is > > lower than the cost of your own time. One can not know everything > > that''s out there and be great at it. > > You are getting the wrong message then. Outsourced is one thing, > shareware/freeware code is another. But referring to your outsourcing > reference, there are a lot of Indian code factories that cannot offer > half of what a domestic, on-site developer can offer. With respect to > being great, it has to have some serious backing before loads of > organizations would adopt published code. > > > > I was talking about learning and exploring, not implementing > > > something head first. > > > Exactly, I spend a fair amount of my free time reading RSS feeds to > > be in the loop on what''s out there. I like to spend my evenings > > experimenting and trying to see if a solution would be feasible for > > the projects I''m working on within my company. > > As do I. If anything, the majority of it is to see what is possible, > what can be done, and most importantly, to give me the knowledge to be > able to learn the code behind the features it brings, not to simply > give me ways to copy someone else''s recipe for a soup I want. I love > expanding what I''m doing, but not to the point my apps are > questionable down the road, and dependent upon single author''s > websites that can disappear overnight. I don''t expect that to happen > to any of the tools I use, and that too is a crapshoot. > > And I don''t like Flash. Heh.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---