编写文件上传功能 [英] Writing a file upload function

查看:64
本文介绍了编写文件上传功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


i有一个表..它包含一个上传和浏览按钮以及一些显示图像的地方。如果我浏览文件(jpg,gif)并上传它应该出现在该表本身的图像位置。我的代码是


[code = html]< form method =" POST" ENCTYPE = QUOT;多部分/格式数据" ACTION =" abc.Action"

< table cellpadding = 0 cellspacing = 0 border = 0 style =''top:40px; left:0px; position:absolute; z-index: 0;''width = 130px>


< TR>

< TD vAlign = top width = 8 bgColor = white>< IMG src =" ../../ images / a.gif">< / TD>

< TD background =" ../../ images / b.gif" >< / TD>

< TD vAlign = top align = right width = 20 bgColor = white>< IMG src =" ../../ images / patreg / c。 gif">< / TD>

< / TR>

< TR>

< TD background =" ../../images/d.gif" nowrap>< / TD>

< TD bgcolor =#dbeaf5>


< table height = 250px>< tr>< td valign =顶部>

< img src =" ../../ g.gif"风格= QUOT;高度:100像素;宽度:100像素;" > < / td>< / tr>

< tr>< td valign = bottom>< input type =" file"名称= QUOT;文件" ID = QUOT; uploadme" size = 1 />

< input type =" button"值= [上载" onclick =''javascript :UploadFile();''class = ButtonStyl es align = bottom>< / td>< / tr>

< / table>

< / td>

< TD background =" ../../ images / egif" >< / TD>

< / tr>< tr>

< TD vAlign = bottom width = 8 bgColor = white>< IMG src =" ../../ images / f.gif">< / TD>

< TD background =" ../../ images / g.gif" >< / TD>

vAlign = bottom align = right width = 20 bgColor = white>< IMG src =" ../../ images / h.gif">< ; / TD>

< / TR>

< / TBODY>

< / table>

展开 | 选择 | Wrap | 行号

解决方案

亲爱的!

你应该使用正确的代码标签。

无论如何你不需要拥有自己的功能。

HTML中有FILE标签。

在Google文件HTML标签上寻求帮助。祝你好运。


亲切的问候,

Dmjpro。


Heya,Honey99。


更改主题标题以更好地描述问题。


只需提交表格即可上传文件。



Heya,Honey99。


更改主题标题以更好地描述问题。


只需提交表单即可上传文件。



没有...实际上我想要的是当我上传一个图像文件时它应该显示在该表本身..可以任何人给我一个上传示例图像

hi!

i have a table..which consists of a upload and browse buttons and some place to display an image.if i browse a file(jpg,gif) and upload,it should appear in place of image in that table itself.my code is

[code=html]<form method="POST" ENCTYPE="multipart/form-data" ACTION="abc.Action">
<table cellpadding=0 cellspacing=0 border=0 style=''top:40px;left:0px;position:absolute;z-index:0;'' width=130px >

<TR>
<TD vAlign=top width=8 bgColor=white><IMG src="../../images/a.gif"></TD>
<TD background="../../images/b.gif" ></TD>
<TD vAlign=top align=right width=20 bgColor=white><IMG src="../../images/patreg/c.gif"></TD>
</TR>
<TR >
<TD background="../../images/d.gif" nowrap></TD>
<TD bgcolor=#dbeaf5>

<table height=250px><tr><td valign=top>
<img src="../../g.gif" style="height:100px;width:100px;" > </td></tr>

<tr><td valign=bottom><input type="file" name="file" id="uploadme" size=1 />
<input type="button" value="UpLoad" onclick=''javascript:UploadFile();''class=ButtonStyl es align=bottom></td></tr>
</table>
</td>
<TD background="../../images/e.gif" ></TD>
</tr><tr>
<TD vAlign=bottom width=8 bgColor=white><IMG src="../../images/f.gif"></TD>
<TD background="../../images/g.gif" ></TD>
vAlign=bottom align=right width=20 bgColor=white><IMG src="../../images/h.gif"></TD>
</TR>
</TBODY>
</table>

Expand|Select|Wrap|Line Numbers

解决方案

Hi Honey!
You should use Proper Code tags.
Anyway you need not to have your own function.
There is FILE tag in HTML.
Look for help in Google on File HTML Tag.
Best of luck.

Kind regards,
Dmjpro.


Heya, Honey99.

Changed thread title to better describe the problem.

Simply submit the form to upload the file.


Heya, Honey99.

Changed thread title to better describe the problem.

Simply submit the form to upload the file.


no...actually what i want is when i upload an image file it should be displayed in that table itself..can anybody give me an example for uploading an image


这篇关于编写文件上传功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆