Re: [Boston.pm] reading in a directory
On Tue, 7 Dec 2004, [EMAIL PROTECTED] wrote: Wow, well it's good to see we're all on the same page. Three replies all suggesting the same option.. zipped files. Yeah here's the trick. I'm trying to make this process easier for my mother, not myself. So in the end, this is adding another layer... So, if I don't want to do the zipped files idea (which is a kinda snazzy idea btw) then I have only two other options: 1) do the list of sinlge file selections as suggested, or 2)use another programming language (javascrip or java I would imagine) to connect to the local machine, browse, select the folder, find the files, and submit them in the form as hidden fields (somehow). The newer XForms (http://www.w3.org/TR/xforms/) also don't specify a way to browse a directory, so I suspect filenames will be the state of things for a while. I think it is considered insecure to allow server-side code to browse an entire directory. I don't know if it's difficult to hit Ctrl-A in the file selection box and thus select all the files in the directory - that would be the easiest solution without subfolders and no zip files would be required. You should think about what you're really trying to achieve. If the goal is to upload the contents of a folder including subfolders wherever it may be, that's another thing and zip files are the best solution. If the goal is JUST to send images or do other client-side processing, provide a Perl script that creates the archive and uploads it to a target server location (optionally, signal the server to analyze the upload afterwards). Make the source location static and your mom will not have to enter command-line arguments but instead she can just double-click on an executable that will do everything; your script can empty the source location upon completion. Ted ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
Yeah, I'm not too excited about creating a connection to a user's desktop to browse it either. But since there's no easy way to send multiple file addresses through html I'm running out of options. And, yeah (you'll love this), my mother uses a Mac. And I was hoping to make this whole procedure platform independent. I know I could be wishing upon a star here. But I gotta try. --Alex On Tue, 2004-12-07 at 16:31, Alex Brelsfoard wrote: Wow, well it's good to see we're all on the same page. Three replies all suggesting the same option.. zipped files. Yeah here's the trick. I'm trying to make this process easier for my mother, not myself. So in the end, this is adding another layer... So, if I don't want to do the zipped files idea (which is a kinda snazzy idea btw) Why not? If she is using XP, then, IIRC, she can zip up a directory as a right click option (been a while). WinZip, properly installed, should also provide a click-menu way of compressing a directory. You might have to experiment with configurations to get the right zip settings/unzipping commands to cooperate at both ends, but since it's you and your mother, I expect you have a fair amount of control over that aspect. But if you like the concept, I'd be surprised if an hour or two experimentation didn't find a workable method, even for your mother. Anyone know if there is a MS version of stuffit? On Tue, Dec 07, 2004 at 02:13:16PM -0600, Alex Brelsfoard wrote: You could use Java applets or MS ActiveX (or whatever it's called now) for multiple uploads. Otherwise, you're stuck with uploading single files. The very idea of giving a web browser the power to browse my directory tree and upload files I didn't explicitly indicate gives me hives. ActiveX == gaping security hole, JMHO -- Sean Quinlan [EMAIL PROTECTED] ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
Thanks all for the great feedback. Yeah, I think the main problem is that I am trying to access remote files from a server-side program, and this is a security violation (rightfully so). So this means (to do this the perfect beautiful way) I will need to create a module to my perl app to be sent over to the end user when trying to do a batch upload (such as a java app). Though I am planning on learning Java soon, when I write this module in Java, I will probably be tempted to re-write the entire thing in Java We'll see. I'm thinking until I have learned another programming language that can be run on the user's side, I will probably just have to do a large number of single selection input fields. I can't remember who at this point, but someone wondered why I didn't just use the html input field and hit ctrl-a. This is exaclty what I would love to do, but if you create that html form with the use of that 'input type=file' field you will notice that it does not let you do ctrl-a. It will only ever select one file at a time. sigh I may at some point try some sort of VB or C# bit. But I really don't like those languages... at all. Thanks again all. --Alex On Tue, 2004-12-07 at 16:31, Alex Brelsfoard wrote: Wow, well it's good to see we're all on the same page. Three replies all suggesting the same option.. zipped files. Yeah here's the trick. I'm trying to make this process easier for my mother, not myself. So in the end, this is adding another layer... So, if I don't want to do the zipped files idea (which is a kinda snazzy idea btw) Why not? If she is using XP, then, IIRC, she can zip up a directory as a right click option (been a while). WinZip, properly installed, should also provide a click-menu way of compressing a directory. You might have to experiment with configurations to get the right zip settings/unzipping commands to cooperate at both ends, but since it's you and your mother, I expect you have a fair amount of control over that aspect. But if you like the concept, I'd be surprised if an hour or two experimentation didn't find a workable method, even for your mother. Anyone know if there is a MS version of stuffit? On Tue, Dec 07, 2004 at 02:13:16PM -0600, Alex Brelsfoard wrote: You could use Java applets or MS ActiveX (or whatever it's called now) for multiple uploads. Otherwise, you're stuck with uploading single files. The very idea of giving a web browser the power to browse my directory tree and upload files I didn't explicitly indicate gives me hives. ActiveX == gaping security hole, JMHO -- Sean Quinlan [EMAIL PROTECTED] ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
Alex Brelsfoard wrote: Yeah, I'm not too excited about creating a connection to a user's desktop to browse it either. But since there's no easy way to send multiple file addresses through html I'm running out of options. One of the online photo processors (ofofo maybe?) used to have a java droplet of some sort where you'd crank it up and just drop images onto it. It was slick when it worked, but it was a little flakey. And, yeah (you'll love this), my mother uses a Mac. And I was hoping to make this whole procedure platform independent. I know I could be wishing upon a star here. But I gotta try. Hrm. The easiest thing, by a huge long shot, would be for her to have a .mac account and just use iPhoto. Okay, maybe not the cheapest ($100/yr). But she'd really point and click pretty effortlessly. Assuming, of course, that your goal is just for her to be able to share photos. I know, it's not as satisfying as writing your own solution. But it is really the seamless and easy solution. It's not what I do with my own photos. But if my mom were wanting to share photos, that's what I'd have her do. --d ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
I have an online photo album that all my friends and family use to share photos and comments on these photos with each other. It's fairly robust, and was [EMAIL PROTECTED] fun to create. But that is the ultimate destination for her pictures. She has a digital camera and might be able to swing the use of a FTP client. But the idea of this is that everyone is lazy and busy. So I need to make this dreafully easy for the uploader or uploads will not occur. Sad but true. --Alex Alex Brelsfoard wrote: Yeah, I'm not too excited about creating a connection to a user's desktop to browse it either. But since there's no easy way to send multiple file addresses through html I'm running out of options. One of the online photo processors (ofofo maybe?) used to have a java droplet of some sort where you'd crank it up and just drop images onto it. It was slick when it worked, but it was a little flakey. And, yeah (you'll love this), my mother uses a Mac. And I was hoping to make this whole procedure platform independent. I know I could be wishing upon a star here. But I gotta try. Hrm. The easiest thing, by a huge long shot, would be for her to have a .mac account and just use iPhoto. Okay, maybe not the cheapest ($100/yr). But she'd really point and click pretty effortlessly. Assuming, of course, that your goal is just for her to be able to share photos. I know, it's not as satisfying as writing your own solution. But it is really the seamless and easy solution. It's not what I do with my own photos. But if my mom were wanting to share photos, that's what I'd have her do. --d ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
AB == Alex Brelsfoard [EMAIL PROTECTED] writes: AB I have an online photo album that all my friends and family use to AB share photos and comments on these photos with each other. It's AB fairly robust, and was [EMAIL PROTECTED] fun to create. But that is the AB ultimate destination for her pictures. She has a digital camera AB and might be able to swing the use of a FTP client. But the idea AB of this is that everyone is lazy and busy. So I need to make this AB dreafully easy for the uploader or uploads will not occur. Sad AB but true. then just write a simple tk or cli app that does the ftp. it can list the local files, she can click on them and it ftps them. probably less work than doing client and server java (and it is pure perl). browsers were never designed to do much and they are overloaded to the max now. classic marketplace beating out quality (in terms of the http/browser platform for all things). uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
Sounds like a neat idea. But I am very inexperienced in TK. Can you point me to a good place online to do some studying? --Alex AB == Alex Brelsfoard [EMAIL PROTECTED] writes: AB I have an online photo album that all my friends and family use to AB share photos and comments on these photos with each other. It's AB fairly robust, and was [EMAIL PROTECTED] fun to create. But that is the AB ultimate destination for her pictures. She has a digital camera AB and might be able to swing the use of a FTP client. But the idea AB of this is that everyone is lazy and busy. So I need to make this AB dreafully easy for the uploader or uploads will not occur. Sad AB but true. then just write a simple tk or cli app that does the ftp. it can list the local files, she can click on them and it ftps them. probably less work than doing client and server java (and it is pure perl). browsers were never designed to do much and they are overloaded to the max now. classic marketplace beating out quality (in terms of the http/browser platform for all things). uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
On Wed, Dec 08, 2004 at 12:20:38PM -0500, Uri Guttman wrote: browsers were never designed to do much and they are overloaded to the max now. classic marketplace beating out quality (in terms of the http/browser platform for all things). Amen! Truer words were never spoken. You would not believe the number of times, I have determined the best solution to be a client based GUI app using tk or WxWidgets (formerly WxWindows) then been forced, instead, to use a browser because everybody knows how to use a browser! -Gyepi ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
AB == Alex Brelsfoard [EMAIL PROTECTED] writes: AB Sounds like a neat idea. But I am very inexperienced in TK. Can you AB point me to a good place online to do some studying? dunno any online places but the docs for perl/tk aren't bad and o'reilly's book mastering perl/tk is decent i hear (skip the learning perl/tk book). a basic top level thing would be a widget to enter a dir and another to allow selecting from its list of files (pix?). then an upload button to take the files and upload to the server. not a complex UI i would think as this is a one task app, make it easy for mom to upload pix. so learn basic perl/tk which isn't hard and then create the widgets you need and populate them. you could also choose wxwindows (apparently renamed to wxwidgets) as it has a perl binding. also you can prototype widget UIs with glade and some other tools. then all you need to do is write the dir reading code and to stuff the select widget and the upload code (ftp i assume which is easy). this would be the path of least work IMO. uri -- Uri Guttman -- [EMAIL PROTECTED] http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs http://jobs.perl.org ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
[Boston.pm] reading in a directory
Howdy all. I have a quick (hopefully) and easy (hopefully) question you might be able to help me with. I would like to create a form (html) that takes in a little bit of info. Most importantly I want it to give the user an option to select a directory from their hard drive. Much like the input type=file option, only with this I want to select a directory. Once that directory is selected and the form submitted I then plan on reading in the names of each file. I will do more there, but I know what I'm doing past there. So the two parts I need help with are: 1) how to select a folder through an html form (being generated by perl) 2) how to read the contents of said folder (would the regular readdir() function work here). Any suggestions here? Thanks. --Alex ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
hi ( 04.12.07 14:13 -0600 ) Alex Brelsfoard: But say I want to upload all of the pictures from a wedding or something. zip them up into one file. [pre-process] i don't think the browser file selection controls are anywhere near as flexible as local graphical file selection controls. i think you're best off keeping the browser file upload part as simple as possible [since it is already complex and overloaded]. -- \js oblique strategy: work at a different speed ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
php does multiple file uploads; I've seen it work but haven't looked at how it manages it. More here: http://www.php.net/manual/en/features.file-upload.multiple.php On Tue, 7 Dec 2004 15:31:22 -0600 (CST), Alex Brelsfoard [EMAIL PROTECTED] said: Wow, well it's good to see we're all on the same page. Three replies all suggesting the same option.. zipped files. Yeah here's the trick. I'm trying to make this process easier for my mother, not myself. So in the end, this is adding another layer... So, if I don't want to do the zipped files idea (which is a kinda snazzy idea btw) then I have only two other options: 1) do the list of sinlge file selections as suggested, or 2)use another programming language (javascrip or java I would imagine) to connect to the local machine, browse, select the folder, find the files, and submit them in the form as hidden fields (somehow). Well, if anyone else comes up with a neat idea, let me know. I'll let y'all know if I come up with something interesting myself. Thanks for all the feedback. I appreciate it. --Alex ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm
Re: [Boston.pm] reading in a directory
To add to the list of options: There is a module for Apache known as mod_dav that implements Web Folders (DAV). DAV is very nicely supported on Windows and Mac (less well on Linux) and will let you treat a server space as a folder; file transfers are done via HTTP GET and PUT. However, installing mod_dav requires adding mod_dav to the web server. To bring this back to perl, some time ago I used mod_dav to build a user-transparent revision control system, which was merely a small number of mod_perl handlers to archive every PUT. -Daniel On Tue, 07 Dec 2004 19:33:16 -0500, Tom Metro [EMAIL PROTECTED] wrote: James Linden Rose, III wrote: http://www.php.net/manual/en/features.file-upload.multiple.php It seems to be showing PHP's ability to parse multiple files in the upload, but not now you get multiple files into the HTML form code in the first place. Agreed. I don't know PHP but the code snippet seems to be illustrating how to easily process several uploaded files as an array, but presumes on the HTML form side of things that there is a finite and known quantity of files. Alex Brelsfoard wrote: So i am trying to create a batch upload system for these purposes. I can do this for one file. I just need to make it possible for more than one... The zip approach, as others have suggested, is the most straight forward approach. It is commonly used. For example, Yahoo's Store uses this trick to allow you to upload batches of product images. On the server side, zip should be easy to deal with. There are Perl modules for unpacking zip files. Should I be seeing if there is a way I can get the user to be able to select more than one file from their computer (as opposed to selecting a directory)? As far as a stock web browser is concerned, I think you'll find that'll be a dead end. Or am I simply going to have to get inventive with the use of several languages? ...use another programming language (javascrip or java I would imagine) to connect to the local machine, browse, select the folder, find the files, and submit them in the form as hidden fields (somehow). I don't think JavaScript alone will help. A Java applet should do it from what I understand, though you'll need to adjust security settings to allow Java applets (or perhaps your specific applet) access to the file system. Other options include: Use an FTP client. I believe most modern web browsers can do batch uploads and support drag-and-drop in their built-in FTP clients. If not, there are plenty of user friendly FTP clients to chose from. (I took this approach for a similar project years ago, and used a customized FTP server to process the files.) Write a stand-alone client in Perl that communicates with your CGI directly. See the latest Perl Journal for articles on Win32::GUI and a tool for turning Perl scripts into an executable file. Perl/Tk is another GUI option. Write a Mozilla Firefox extension or Mozilla XUL application. Once installed this avoids the security restrictions that a Java applet would have, and you could probably implement it with just JavaScript. Write a stand-alone client in C#. It appears you can freely download the .NET SDK from Microsoft, which includes a C# command line compiler. Then pair that up with an open source C# IDE that provides the GUI builder. Basically a free Visual Basic without all the ugliness of Visual Basic. (I haven't played around with this, but I've got the URLs if anyone is interested.) -Tom ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm ___ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm