Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<b>Help me with File Uploading code </b>

Status
Not open for further replies.

tkanvar

Programmer
Jun 20, 2002
5
IN
Hi,

I used the following code to upload files to the folder "C:/uploads" using aspSmartUpload. And I get "1 file uploaded" message also. But the file is not actually uploaded in to the folder. Please help me to solve this problem. I use windows 98 and Personal Web Server.

thank you
Anvar

<code>
<%
' Variables
' *********
Dim mySmartUpload
Dim intCount

' Object creation
' ***************
Set mySmartUpload = Server.CreateObject(&quot;aspSmartUpload.SmartUpload&quot;)

mySmartUpload.Upload


' sample with a physical path
intCount = mySmartUpload.Save(&quot;C:\uploads&quot;)

' Display the number of files uploaded
' ************************************
Response.Write(intCount & &quot; file uploaded.&quot;)
%>
</code>
 
Here's the sample code from aspSmartUpload (
Code:
<HTML>
<BODY BGCOLOR=&quot;white&quot;>

<H1>aspSmartUpload : Sample 1</H1>
<HR>

<%
'  Variables
'  *********
   Dim mySmartUpload
   Dim intCount
        
'  Object creation
'  ***************
   Set mySmartUpload = Server.CreateObject(&quot;aspSmartUpload.SmartUpload&quot;)

'  Upload
'  ******
   mySmartUpload.Upload

'  Save the files with their original names in a virtual path of the web server
'  ****************************************************************************
   intCount = mySmartUpload.Save(&quot;/aspSmartUpload/Upload&quot;)
   ' sample with a physical path 
   ' intCount = mySmartUpload.Save(&quot;c:\temp\&quot;)

'  Display the number of files uploaded
'  ************************************
   Response.Write(intCount & &quot; file(s) uploaded.&quot;)
%>
</BODY>
</HTML>

looks like you should try a second backslash...:
intCount = mySmartUpload.Save(&quot;C:\uploads\&quot;)

---------------------------------------
[turkey] HAPPY THANKSGIVING!!!! [turkey]
mikewolf@tst-us.com
 
Hi mwolf00,


I've tried the backslash also.I don't know why it does'nt work. I got the message &quot;1 file(s) uploaded. &quot; when I tried to upload a text file. But still I dont see any file uploaded in to the folder temp( I created a folder temp in C:). Please help me to find a solution

Thanks
Anvar
 
This code is trying to write your file to a folder called &quot;uploads&quot; that is located directly on the &quot;C&quot; Drive. You say that you are looking for the uploaded folder in &quot;temp&quot;... Try looking for a folder called uploads directly on the C drive.

Another thing you can try is to give your uploaded folder a wierd name like &quot;xyz123.txt&quot; and after you upload, do a search for the folder... ---------------------------------------
[turkey] HAPPY THANKSGIVING!!!! [turkey]
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top