[Zope] Still Problem with LocalFS

2000-07-13 Thread Jorgen Gardsted Jorgensen

I have had a similar problem.
My solution is based on an external method.

I have a folder named localFS with
1) a Local File System named images pointing somewhere in file system.
2) an ExternalMethod called addFile looking like this:

def addFile(self, file, fullpath):
 outfile = open(fullpath, 'w')
 outfile.write(file.read())
___

the Upload form has this input:

INPUT TYPE="file" NAME="file" SIZE="25" VALUE=""


the action-method  looks somewhat like this.

dtml-call
"REQUEST.set('fullpath',localFS.images.getProperty('basepath'))"
dtml-call "REQUEST.set('imgresult',localFS.addFile(file,fullpath))"


This is all very new to me. The file is there, and I can read it, so it
should work, I guess.
There's no error checking though, so be careful.
I also intend to let the external method return something meaningful
instead of None.

best regards Jørgen


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Still Problem with LocalFS

2000-06-27 Thread jensebaer


- Original Message -
From: jensebaer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, June 24, 2000 6:52 PM
Subject: Re: [Zope] Re: Problem with LocalFS


Ok now I placed the dtml files (savefile.dtml upload.dtml) in the LocalFS
Folder but the problem is still the same:
When I use manage_addImage (now from inside LocalFS) the new image is
created in the folder above.
I don´t no how but there must be a way to add an Image to LocalFS by using
another addimage form then the given.
My I have to use another manage function?
Or is there a special sytax to do this?
You wrote that it works from inside LocalFS so may you can give me an
example.

Thank you

Jens


- Original Message -
From: Jonothan Farr [EMAIL PROTECTED]
To: jensebaer [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, June 23, 2000 2:35 AM
Subject: [Zope] Re: Problem with LocalFS


This is a known problem with LocalFS. The only workaround I know of is to
put
your dtml code into a file, give it a .dtml extension, and place it in the
directory you want to upload to. This problem will be addressed in the next
version of LocalFS.

--jfarr

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

- Original Message -
From: jensebaer [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 22, 2000 5:23 PM
Subject: [Zope] Problem with LocalFS


Hello,

I want to upload files to LocalFS.
I created a LocalFS with the id: images

I don´t want to use the existing addImageForm to create a new Image in the
LocalFS.

I want to use two DTML Methods

uploadform

  form action="savefile" methode="POST" ENCTYPE="multipart/form-data"
  Fileinput type="file" name="file" size="25" value=""br
  input type="submit" value="UPLOAD"


and send the data to:

savefile

dtml-call "images.manage_addImages('newfile',file,'titleof tempfile')"


but this do not create a new image in the LocalFS.
It creates an image in the Folder in which the the LocalFS exists.

I do not understand why 

Jens



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )