Re: Timestamp for Apache::Upload uploads.

2003-01-15 Thread Joe Schaefer
"Matthew Hodgson" <[EMAIL PROTECTED]> writes:

[...]

> It seems that the question is less to do with mod_perl, and more to do with
> whether any current browsers give Last-Modified or Modification-Date or
> similar information in the MIME headers for multipart/form-data uploads.
> Whilst I had convinced myself that I'd seen this working, I'm starting to
> doubt my memory.

Not to my knowledge;  I suspect you've been stat()ing the spooled
temp file all along.

-- 
Joe Schaefer



Re: Timestamp for Apache::Upload uploads.

2003-01-14 Thread Matthew Hodgson
Geoffrey Young wrote:
>
> Matthew Hodgson wrote:
> > Hi,
> >
> > I could have sworn that at some point under Apache/1.3.27 and
mod_perl/1.27
> > I had the ability to find a timestamp of some kind for uploaded files
using
> > Apache::Upload.  To be precise, I thought that:
> >
> > $upload = $apr->upload;
> > $filehandle = $upload->fh;
> > $timestamp = (stat($filehandle))[9];
> >
>
> I would think that would work (on unix variants, at least)
>
> the other thing you can try is (stat($upload->tempname))[9]
>

Thanks for the suggestion, Geoff; trying the following code snippet...

   my $upload = $apr->upload;
   my $info = $upload->info;
   while (my($key, $val) = each %$info) {
  print STDERR "Upload: $key: $val\n";
   }
   print STDERR "stat(\$upload->fh) = ".join(",",stat($upload->fh))."\n";
   print STDERR "stat(\$upload->tempname) =
".join(",",stat($upload->tempname))."\n";

...yields...

Upload: Content-Disposition: form-data; name="sa_spec_upload";
filename="G:\misc\test.jpg"
Upload: Content-Type: image/pjpeg
stat($upload->fh) =
18438,17,33152,1,487,487,0,88534,1042551991,1042551995,1042551995,4096,184
stat($upload->tempname) =
18438,17,33152,1,487,487,0,88534,1042551991,1042551995,1042551995,4096,184

i.e. the atime, mtime and ctime fields of both stat()'s all give timestamps
which describe the temporary file - rather than the source file's details as
it was on the client machine before being uploaded - which is what I could
have sworn I once had working.  (The mtime field of the local file is
1020735075).

It seems that the question is less to do with mod_perl, and more to do with
whether any current browsers give Last-Modified or Modification-Date or
similar information in the MIME headers for multipart/form-data uploads.
Whilst I had convinced myself that I'd seen this working, I'm starting to
doubt my memory.

Any additional help would really be appreciated;

thanks,

Matthew.





Re: Timestamp for Apache::Upload uploads.

2003-01-14 Thread Geoffrey Young


Matthew Hodgson wrote:

Hi,

I could have sworn that at some point under Apache/1.3.27 and mod_perl/1.27
I had the ability to find a timestamp of some kind for uploaded files using
Apache::Upload.  To be precise, I thought that:

$upload = $apr->upload;
$filehandle = $upload->fh;
$timestamp = (stat($filehandle))[9];



I would think that would work (on unix variants, at least)

the other thing you can try is (stat($upload->tempname))[9]

HTH

--Geoff




Timestamp for Apache::Upload uploads.

2003-01-13 Thread Matthew Hodgson
Hi,

I could have sworn that at some point under Apache/1.3.27 and mod_perl/1.27
I had the ability to find a timestamp of some kind for uploaded files using
Apache::Upload.  To be precise, I thought that:

$upload = $apr->upload;
$filehandle = $upload->fh;
$timestamp = (stat($filehandle))[9];

yielded some kind of intelligent timestamp for an uploaded file (last
modification time of the original file on the client computer, istr) when
upped using IE6 or Mozilla 1.2 from Windoze.

However, on trying to recreate this I'm having no joy whatsoever.  On
looking through the $upload->info tied hash, the only mime headers that IE6
provides appear to be

Content-Disposition: form-data; name="sa_spec_upload";
filename="G:\download\filename.jpg"
Content-Type: application/octet-stream

...which is notably lacking any time-related information at all.

Am I completely imagining this ever having worked?  Does anyone know of any
special circumstances where typical browsers such as Mozilla or IE would
submit timestamps for the source file somewhere in the multipart/form-data
MIME encoding?

thanks in advance,

Matthew.