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.


Reply via email to