Hello dukeja, > such as ./attachment/[[tag]]/[[tiddler]]
How would it know, before dropping, what 'tag' and 'tiddler' are? If you change the tiddler name, would you expect the file structure to change too? That would be really, really messy. Its better to physically relocate the files into a place known to TW, though with slight relationship to the contents of the original file. For example, when you dropped a file with name f:\mystuff\pictures \birthday2006.ppt to your TW, it would create a tiddler that might look like: # [[birthday2006.pdf|data1/birthday2006.ppt]] cd c:\tw\data copy f:\mystuff\pictures\birthday2006.ppt . You could then save this tiddler as "temp.bat" or whatever name you wanted to give it, and then run it by double-clicking on it. As your data1 directory filled up, you could create a new directory "data2" and change your configuration to drop everything there. There's not much point in creating a series of directories below tw. Ok, I guess it would help with possible name collisions. In that case, the result might look like: # [[birthday2006.pdf|data1/birthday2006.ppt]] cd c:\tw\data mkdir mystuff mkdir mystuff\pictures copy f:\mystuff\pictures\birthday2006.ppt mystuff\pictures This example code assumes Windows syntax. It would have to different for Un*x of course. The configuration code I've already written, and presented only makes tiddler links, but can translate absolute to relative paths, so that the result is potentially more portable. Still thinking out loud, obviously ... -- Mark On Feb 10, 3:25 pm, dukeja <[email protected]> wrote: > Mark: > > I am thinking about the same approach (I think) as you did. > Basically, the FileDrop capture the path(s) of target file(s) or folder > (s), and figure out a destination folder, which is user pre-defined > pattern (such as ./attachment/[[tag]]/[[tiddler]] with illegal > characters removed). It then handed such information outside to a > shell script level program to execute. This is to work around the > security issue. (Bear with me if I don't know what I am saying). If > the same mechanism can be used to monitor the TW so that if all > tiddlers related to one attachment are deleted, the user will be > prompted to delete those files. > > I was hoping such hybrid approach (not elegant) might work. > > (Go back to you last posting on Feb 9, 10:56 pm) Could you elaborate > a little bit more how is your modification work? and what's the end > result? Thanks! > > Duke > > On Feb 9, 1:34 pm, "Mark S." <[email protected]> wrote: > > > Hi Eric, > > > Is there an easy way to set FileDropPluginConfig, so that it always > > links and never embeds -- even for text files? Basically, I just want > > to drag and drop links to files (preferably with a relative path so > > that it will work anywhere.) I guess having intelligent drag-and-drop > > links (e.g. formatted as links for files but as images for images) > > would be cool, but even just having not to type the path by hand would > > be a good start. > > > The concept of embedding files is really cool, but the only benefit > > over file linking is that its a bit simpler to carry everything as one > > file on your thumbdrive. Without a synchronization tool (e.g. rsync) > > it might be a bit tedious to carry along a set of files rather than > > one file. > > > So .... thinking out loud. What about dragging and dropping a file, > > which creates a batch file script in the tiddler? Then the actual > > human being could copy the tiddler out to a bat file (or sh, depending > > on system), and run the code which would set up directories, copy the > > files, etc. This would bypass the sensible security limitations on > > javascript, handing-off the responsibility to a human who, hopefully, > > knows that its OK to copy file "B" to new location "Z". > > > -- Mark > > > On Feb 9, 8:57 am, Eric Shulman <[email protected]> wrote: > > > > > moderate sized image and got a new tiddler with the following info: > > > > > plot2.jpg type=image/jpeg, size=128810 bytes, encoded=174431 bytes > > > > > But every time when I try to open that tiddler, there will be a long > > > > delay and FF3 will report a unresponsive script. The tiddler will > > > > eventually open and the full size image show in the tiddler. But this > > > > is not so usable with even larger size image. > > > > > Did I missed anything? I read some people also have issues with > > > > several MB video file. So I guess the embedding process slow it > > > > down. > > > > In general, photos and other media files are, for practical use, too > > > big to embed as base64-encoded content, primarily due to performance > > > issues. Encoded images are best used for relatively small graphics, > > > such as icons, logos, and background textures. > > > > > I wonder if it is possible to NOT embedded the file into a tiddler but > > > > AttachFilePlugin supports *three* different ways to attach a file: > > > * embedded base64-encoded data > > > * a local file/path reference > > > * a URL > > > > If there is no embedded data in the attachment tiddler, then the local > > > path/file is used (if any). If there is no local file information (or > > > the file does not actually exist), then the attachment falls back to > > > using a remote URL (if specified). > > > > There is a Configuration section in FileDropPluginConfig that you can > > > use to control whether or not *encoded* data will be included in the > > > attachment tiddler. > > > > > Since the main headache of using external file are maintaining the > > > > relative link and file storage. > > > > Using TiddlyWiki to automatically copy/create new directories and > > > files in your filesystem is not a good idea: file and directory I/O > > > functions from javascript are subject to security restrictions > > > (especially for writing *binary* files), and there are significant > > > browser-specific and OS-specific limitations that make reliable > > > implementation extremely difficult. At best, it's a large, complex > > > chunk of code... at worst, there's just too many ways that the > > > functions can fail, with the potential for filesystem corruption > > > (badly formed directories/files) or loss of data (from deleting the > > > wrong file). > > > > However, even without automatic manipulation of the external > > > filesystem, you can still use AttachFilePlugin/FileDropPlugin much as > > > you have described... except that you will still have to manually > > > create and maintain the external folder of images, rather than having > > > the plugin do it for you. > > > > enjoy, > > > -e > > > Eric Shulman > > > TiddlyTools / ELS Design Studios --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/TiddlyWiki?hl=en -~----------~----~----~----~------~----~------~--~---

