473,398 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Original file datestamp in uploads

How can I get the original datestamp of uploaded files?

The array $_FILES doesn't seem to contain the original date.
Any solution?
Daniele
Mar 3 '06 #1
8 2120
d
"Daniele Baroncelli" <ub******@libero.it> wrote in message
news:du**********@newsreader.mailgate.org...
How can I get the original datestamp of uploaded files?

The array $_FILES doesn't seem to contain the original date.
Any solution?
The $_FILES tells you where the temp file is, so just use the filemtime() on
that file, and that will tell you when the upload happened.

Daniele


Dave
Mar 3 '06 #2
"Daniele Baroncelli" <ub******@libero.it> wrote in message
news:du**********@newsreader.mailgate.org...
How can I get the original datestamp of uploaded files?

The array $_FILES doesn't seem to contain the original date.
Any solution?

The timestamp the file had in the client machine is lost in the transfer,
you can only get the time it arrived at the server. Only way to access
client fielsystem would propably be ActiveX which is the
supercalifragilisticexpialidocious IE implementation of
"security-shmecurity" that in some cases actually is enabled in clients IE
browsers. But I'm not recommending you to go that way, just live with the
fact that you don't get the timestamp from uploaded files.

--
"En ole paha ihminen, mutta omenat ovat elinkeinoni." -Perttu Sirviö
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Mar 3 '06 #3
>> How can I get the original datestamp of uploaded files?

The array $_FILES doesn't seem to contain the original date.
Any solution?

The timestamp the file had in the client machine is lost in the transfer,
you can only get the time it arrived at the server. Only way to access
client fielsystem would propably be ActiveX which is the
supercalifragilisticexpialidocious IE implementation of
"security-shmecurity" that in some cases actually is enabled in clients IE
browsers. But I'm not recommending you to go that way, just live with the
fact that you don't get the timestamp from uploaded files.

Pretty shit! :-(((

Is it a lack of the PHP implementation, or a limitation of the HTTP
protocol?

Does anyone has an example of how I can get the timestamp of file selected
in the upload input trough ActiveX?

I would need to know the original timestamp, because I am building a "photo
blog" CMS and I want to store the photos timestamp in the database.

Any help is very welcome.
Daniele
Mar 3 '06 #4

Daniele Baroncelli wrote:
How can I get the original datestamp of uploaded files?

The array $_FILES doesn't seem to contain the original date.
Any solution?

The timestamp the file had in the client machine is lost in the transfer,
you can only get the time it arrived at the server. Only way to access
client fielsystem would propably be ActiveX which is the
supercalifragilisticexpialidocious IE implementation of
"security-shmecurity" that in some cases actually is enabled in clients IE
browsers. But I'm not recommending you to go that way, just live with the
fact that you don't get the timestamp from uploaded files.

Pretty shit! :-(((


Not really - it's a security thing. In general, the server has no
right/reason to know what time the user created the file, in the same
way that the server has no right/reason to know what folder it was in
on the user's computer, etc. Therefore, browsers don't send this info
with a file upload.

--
Oli

Mar 3 '06 #5
>> Is it a lack of the PHP implementation, or a limitation of the HTTP
protocol?


Not really - it's a security thing. In general, the server has no
right/reason to know what time the user created the file, in the same
way that the server has no right/reason to know what folder it was in
on the user's computer, etc. Therefore, browsers don't send this info
with a file upload.


So, I suppose it must be a limitation of the HTTP protocol.

Which is then the most feasible way to save the original file timestamp in
the database of my CMS system?

Is ActiveX the only way?
(would anyone give me any example of that?)
Cheers

Daniele
Mar 3 '06 #6
El Fri, 3 Mar 2006 14:56:10 +0100
Daniele escribió:
So, I suppose it must be a limitation of the HTTP protocol.
actually it's not a limitation, but a design decision
Which is then the most feasible way to save the original file
timestamp in the database of my CMS system?


from my point of view you have 3 options:
1. ask for the date in a separate field
2. ask the people uploading to use a fixed format for the files
(i.e. if someone took a photo on 2/2/2006 ask them to rename the file
to 20060202.jpeg or something like that)
3. if you just want it for photos you could look the exif headers that
most digital cameras place on the photos they take. apart from the date
you will get camera make & model, orientation of the file,etc...(some
cameras only fill some fields, but I think the date of the photo
should be on most photos taken)
in php this is acomplished using the exif extension, specifically the
exif_read_data function
(http://php.net/manual/en/function.exif-read-data.php).
--
Juan José Gutiérrez de Quevedo
Director Técnico (ju****@iteisa.com)
ITEISA (http://www.iteisa.com)
942544036 - 637447953
Mar 3 '06 #7
Daniele Baroncelli wrote:
How can I get the original datestamp of uploaded files?

The array $_FILES doesn't seem to contain the original date.
Any solution?

The timestamp the file had in the client machine is lost in the transfer,
you can only get the time it arrived at the server. Only way to access
client fielsystem would propably be ActiveX which is the
supercalifragilisticexpialidocious IE implementation of
"security-shmecurity" that in some cases actually is enabled in clients IE
browsers. But I'm not recommending you to go that way, just live with the
fact that you don't get the timestamp from uploaded files.


Pretty shit! :-(((

Is it a lack of the PHP implementation, or a limitation of the HTTP
protocol?

Does anyone has an example of how I can get the timestamp of file selected
in the upload input trough ActiveX?

I would need to know the original timestamp, because I am building a "photo
blog" CMS and I want to store the photos timestamp in the database.

Any help is very welcome.
Daniele


Who says the data of the file is the timestamp on the photo?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 3 '06 #8
> from my point of view you have 3 options:
1. ask for the date in a separate field
2. ask the people uploading to use a fixed format for the files
(i.e. if someone took a photo on 2/2/2006 ask them to rename the file
to 20060202.jpeg or something like that)
3. if you just want it for photos you could look the exif headers that
most digital cameras place on the photos they take. apart from the date
you will get camera make & model, orientation of the file,etc...(some
cameras only fill some fields, but I think the date of the photo
should be on most photos taken)
in php this is acomplished using the exif extension, specifically the
exif_read_data function
(http://php.net/manual/en/function.exif-read-data.php).

Thanks a lot!
I didn't know about the Exif class!
I am going to use that one!

Otherwise, I had figured out how to use the ActiveX FileSystemObject in
javascript:

var fso = new ActiveXObject("Scripting.FileSystemObject");
var f = fso.GetFile(filespec);
var filedate = new Date(f.DateCreated)

Thanks!

Daniele
Mar 3 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: kafooey | last post by:
Hi all, I've been digging around on the newsgroups and the web for a possible answer for this problem, but have so far come up with nothing so thought I would ask here... I have the following...
1
by: Doug Helm | last post by:
I should have been more clear in my subject line. I was also the poster in the "File Uploads" topic. I'm not having any luck getting file uploads to work (multi-part HTML form) on a Windows...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
5
by: Kikoz | last post by:
Hi all. I assume that if the user uploads a file from aspx page IIS will put all future requests to the same page from other users in a line and all of them will be waiting until this upload...
4
by: yehaimanish | last post by:
I am developing the project management system. Each Project: 1. Title, description ... , stored in mysql database 2. Upto ten files (initial description), (name in db, file in file system) 3....
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
6
by: Emmanuel Petit | last post by:
First of all I am rather new into PHP. I use php 5 and I am putting together a web site for a local association I belong too. Most of the site is okay, except for this problem : I need to be...
6
by: Milan Krejci | last post by:
while(list($key,$value) = each($_FILES)) { if(!empty($value)){ $filename = $value; $add = "upimg/$filename"; echo $_FILES; $error=copy($_FILES, $add); if (!$error)...
10
by: =?ISO-8859-1?B?UOlw6g==?= | last post by:
Hello. Im new to php and i had experience in ASP. IM trying to get a pdf file from a remote folder and what happens is that opens a new page. Here is the code: <a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.