0

i'm implementing some upload script with Uploadfy on my site.

This is the script sample i have in PHP:

<script type="text/javascript">
        <?php $timestamp = time();?>
        $(function() {
            $('#file_upload').uploadify({
                'formData'     : {
                    'timestamp' : '<?php echo $timestamp;?>',
                    'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                },
                'swf'      : 'uploadify.swf',
                'uploader' : 'uploadify.php',
                'onUploadSuccess' : function(file, data, response) {
                    alert('The file was saved to: ' + data);
                }
            });
        });
    </script>

But i want this working in classic ASP!

I know i need to change these lines to make this work:

'formData'     : {
                    'timestamp' : '<?php echo $timestamp;?>',
                    'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
                },

But i don't know how to change this to classic ASP. What i need to do??

4

2 回答 2

2

formData 是要发送到您的 url 以供上传的数据

你还需要换行

            'uploader' : 'uploadify.php',

经过

            'uploader' : 'uploadify.asp',

并在您的uploadify.asp页面中实现上传

于 2013-02-15T13:03:29.263 回答
0

我在这里猜测您要做的是在您的 asp 页面中使用变量调用 php 脚本“uploadify.php”。

时间戳变量和 md5 函数在 Classic ASP 中没有准备好,您需要自己编写。对于时间戳,以下应该有效

<% timestamp = year(now) & right("0" & month(now),2) & right("0" & day(now),2) & right("0" & hour(now),2) & right("0" & minute(now),2) & right("0" & second(now),2) %>

MD5 功能比较复杂,但是这里有一个可以下载使用

一旦所有这些都到位 -<?php echo $timestamp;?><%=timestamp%><?php echo md5('unique_salt' . $timestamp);?>替换<%=md5("unique_salt"&timestamp)%>

于 2013-02-19T14:43:32.103 回答