i using jquery uploadify plugin on web page transfer files local computer asp.net mvc2 control action method. there way transfer creation date/time of file server?
i can @ data in uploadify event on client, can not figure out how "package" data moved server w/ file.
any thoughts appreciated.
try using onselect event add values scriptdata object.
update: following ad-hoc view pass data action. appears modificationdate
returns unix timestamp in it's time
field , you'll have convert on server side. wasn't able find documentation on modificationdate
property.
<%@ page language="c#" inherits="system.web.mvc.viewpage<dynamic>" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>home</title><link href="/scripts/uploadify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="/scripts/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="/scripts/swfobject.js"></script> <script type="text/javascript" src="/scripts/jquery.uploadify.v2.1.4.min.js"></script> <script type="text/javascript"> var myscriptdata = {}; $(document).ready(function () { $('#file_upload').uploadify({ 'uploader': '/scripts/uploadify.swf', 'script': '/test/upload', 'cancelimg': '/scripts/cancel.png', 'folder': '/app_data', 'auto': true, 'onselect': function (event, id, fileobj) { $('#file_upload').uploadifysettings('scriptdata', { modifiedtimestamp: fileobj.modificationdate.time }); return true; } }); $('#file_upload').uploadifysettings('scriptdata', myscriptdata); }); </script> </head> <body> <input id="file_upload" name="file_upload" type="file" /> </body> </html>
in action method, can grab timestamp through request.form["modifiedtimestamp"]
. check here on how convert timestamp datetime object.
Comments
Post a Comment