|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
help me to see wat wrong ... thanks
<!--#include file="Loader.asp"-->
<% Response.Buffer = True ' load object Dim load Set load = new Loader ' calling initialize method load.initialize ' File binary data Dim fileData fileData = load.getFileData("file") ' File name Dim fileName fileName = LCase(load.getFileName("file")) ' File path Dim filePath filePath = load.getFilePath("file") ' File path complete Dim filePathComplete filePathComplete = load.getFilePathComplete("file") ' File size Dim fileSize fileSize = load.getFileSize("file") ' File size translated Dim fileSizeTranslated fileSizeTranslated = load.getFileSizeTranslated("file") ' Content Type Dim contentType contentType = load.getContentType("file") ' No. of Form elements Dim countElements countElements = load.Count ' Value of text input field "name" Dim nameInput nameInput = load.getValue("name") ' Path where file will be uploaded Dim pathToFile pathToFile = Server.mapPath("uploaded/") & "\" & fileName ' Uploading file data Dim fileUploaded fileUploaded = load.saveToFile ("file", pathToFile) ' destroying load object Set load = Nothing %> <html> <head> <title>File Uploading with ASP</title> <style> body, input, td { font-family:verdana,arial; font-size:10pt; } </style> </head> <body> <p align="center"> <b>File Uploading with ASP</b><br> <a href="show.asp">To see uploaded files click here</a> </p> <table width="700" border="1" align="center"> <tr> <td>File Name</td><td><%= fileName %></td> </tr><tr> <td>File Path</td><td><%= filePath %></td> </tr><tr> <td>File Path Complete</td><td><%= filePathComplete %></td> </tr><tr> <td>File Size</td><td><%= fileSize %></td> </tr><tr> <td>File Size Translated</td><td><%= fileSizeTranslated %></td> </tr><tr> <td>Content Type</td><td><%= contentType %></td> </tr><tr> <td>No. of Form Elements</td><td><%= countElements %></td> </tr><tr> <td>Name</td><td><%= nameInput %></td> </tr> </table><br><br> <p style="padding-left:220;"> <% If fileUploaded = True Then Response.Write fileName & " data uploaded..." Else Response.Write "<font color=""red"">File could not be uploaded...</font>" Response.Write "<br>Please select a file before hitting the 'Submit' button." End If %> </p> <br> <table border="0" align="center"> <tr> <form method="POST" enctype="multipart/form-data" action="Insert.asp"> <td>Name :</td><td> <input type="text" name="name" size="40" value="<%= nameInput %>"></td></tr> <td>File :</td><td> <input type="file" name="file" size="40"></td></tr> <td> </td><td> <input type="submit" value="Submit"></td></tr> </form> </tr> </table> </body> </html> this coding is save a image into a folder. the foldar name is "uploaded" . but why is not function well .... thanks for help... |
|
#2
|
||||
|
||||
|
Is there an error?
__________________
selwonk If I've posted some code above, you might think it looks a bit simplistic. It might be. I'd rather people tried the next step themselves rather than getting a full solution on a plate. That way they learn more! |
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > help me to see wat wrong ... thanks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|