Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - AspSmartUpload -- File.saveAs not working
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

AspSmartUpload -- File.saveAs not working

 Post Reply Post Reply
Author
vidyaraghav View Drop Down
Newbie
Newbie


Joined: 22 September 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote vidyaraghav Quote  Post ReplyReply Direct Link To This Post Topic: AspSmartUpload -- File.saveAs not working
    Posted: 26 September 2003 at 2:33am

Hi,

   I have a few files on our network server machine.I have a Personal web server with ASPsmartupload registered on it on my machine ..Actually my task is to upload the said file on to my macine's folder considering that Iam the server and the files on the network server are my clients files...Now there is no error in the program ...I tried printing the server.mappath value in the browser ...My destination also seems to be right ...But the file simply doesnt get uploaded i.e saved on to my folder which i have kept for the client..The record details correctly get added to my data base ..But the file uploading alone does'nt happen ...I wonder why?

My code is

For each file In mySmartUpload.Files

If not file.IsMissing Then

fname=file.fileName

response.write server.mappath("Pros.asp")

response.write server.mappath("../quality/clients/"&M_UserId&"/down load")

response.write fname

file.saveAs( server.mappath("../quality/clients/"&M_UserId&"/down load")&"\"&fname)

response.write "File uploaded"

End If

Next

                         Please help me

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2003 at 9:50am

do you get some sort of error ?

with what information you gave, no one will be able to tell you what's wrong

Contribute to the working anarchy we fondly call the Internet
Back to Top
3BEPb View Drop Down
Groupie
Groupie


Joined: 07 August 2003
Location: United States
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote 3BEPb Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2003 at 11:58am

Z, probably he gets just nothing.

Vid, copy everything here, including submission form code. And, meanwhile, check folder (/download) permissions.

Back to Top
vidyaraghav View Drop Down
Newbie
Newbie


Joined: 22 September 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote vidyaraghav Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2003 at 2:20am

There is simply no error on the browser...The files alone do not get copied from the source ..ie our network server

      file://server/hh/d/tr/abc.doc

 

to  my folder namely

       c:\original\qualis\client\<client name>\upload

 

Back to Top
vidyaraghav View Drop Down
Newbie
Newbie


Joined: 22 September 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote vidyaraghav Quote  Post ReplyReply Direct Link To This Post Posted: 27 September 2003 at 2:37am

Let me give the whole code....

Entry  file is

<%@ Language="VBScript"%>

<%

response.buffer=true

response.expires = 0

response.expiresabsolute = Now() - 1

response.addHeader "pragma","no-cache"

response.addHeader "cache-control","private"

Response.CacheControl = "no-cache"

M_UserId = request.querystring("uid")

M_status = request.querystring("status")

if M_UserId="" OR M_UserId="null" then M_UserId ="0"%>

 

<% If M_UserId <> "0" Then %>

<form name="upload" method="post" enctype="multipart/form-data" action="Pros.asp" >

<table width="100%" border="1" cellspacing="0" cellpadding="2" bordercolorlight="#22949d" bordercolordark="#FFFFFF">

<tr>

<td align="center"><b><font color="#000066">Patient First Name</font></b></td>

<td align="center"><b><font color="#000066">Patient Last Name</font></b></td>

<td align="center"><b><font color="#000066">Dictating Doctor</font></b></td>

<td align="center"><b><font color="#000066">Date of Service</font></b></td>

<td align="center"><b><font color="#000066">MR Number </font></b></td>

<td align="center"><b><font color="#000066">Upload File </font></b></td>

</tr>

<tr>

<td>

<input type="hidden" name="userid" value="<%=M_UserId %>">

<input type="text" name="patientfname" size="9" maxlength="25">

</td>

<td>

<input type="text" name="patientlname" size="9" maxlength="25">

</td>

<td>

<input type="text" name="doctorname" size="9" maxlength="25">

</td>

<td>

<input type="text" name="middate" size="8" maxlength="10">

</td>

<td>

<input type="text" name="mid" size="6" maxlength="9">

</td>

<td>

<input type="file" name="file" size="13">

</td>

</tr>

<tr>

<td colspan="6">&nbsp;</td>

</tr>

<tr align="center">

<td colspan="6">

<input type="reset" name="Reset" value="Reset">

<input type="submit" name="Submit" value="Submit">

</td>

</tr>

</table>

</form>

<% Else %>

<center>

<b><font color="#006600">Please Select Userid to Upload files</font></b>

</center>

<% End If %>

</td>

</tr>

</table>

</td>

</tr>

</table>

<table cellspacing=0 cellpadding=0 width=760 border=0>

<tbody>

<tr>

<td><img height=5 src="../Dialpad%20-%20login_files/b.gif" width=1

border=0></td>

</tr>

<tr>

<td colspan=2>&nbsp;</td>

</tr>

<tr>

<td>&nbsp;</td>

<td align=center><span style="FONT-SIZE: 11px; COLOR: #333333">&nbsp; <br>

</span></td>

</tr>

</tbody>

</table>

The uploading file is as follows

<%@ language="vbscript" %>

<%

response.buffer=true

response.expires = 0

response.expiresabsolute = Now() - 1

response.addHeader "pragma","no-cache"

response.addHeader "cache-control","private"

Response.CacheControl = "no-cache"

%>

<%

Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

mySmartUpload.Upload

M_UserId = replace(mySmartUpload.form("userid").values,"'","''")

M_PatientFname = replace(mySmartUpload.form("patientfname").values,"'","''")

M_PatientLname = replace(mySmartUpload.form("patientlname").values,"'","''")

M_DoctorName = replace(mySmartUpload.form("doctorname").values,"'","''")

M_MidDate = replace(mySmartUpload.form("middate").values,"'","''")

M_Mid = replace(mySmartUpload.form("mid").values,"'","''")

set con=server.createobject("ADODB.Connection")

con.open session("DSNPath")

set rsItemCount = Server.createObject("ADODB.recordset")

'------file uploading Begins here

For each file In mySmartUpload.Files

If not file.IsMissing Then

response.write "File name in files is "& file.filename&vbcrlf

fname=file.fileName

response.write "servers mappath"& server.mappath("adminuploadFilesPros.asp")&vbcrlf

response.write "place to upload to "& server.mappath("../quality/clients/"&M_UserId&"/down load")&vbcrlf

sas=server.mappath("../quality/clients/"&M_UserId&"/ download")&"\"&fname

response.write "Server mappath="& sas &vbcrlf

file.saveAs(sas)

Response.Write("Name = " & file.Name & "<BR>")

Response.Write("Size = " & file.Size & "<BR>")

Response.Write("FileName = " & file.FileName & "<BR>")

Response.Write("FileExt = " & file.FileExt & "<BR>")

Response.Write("FilePathName = " & file.FilePathName & "<BR>")

Response.Write("ContentType = " & file.ContentType & "<BR>")

Response.Write("ContentDisp = " & file.ContentDisp & "<BR>")

Response.Write("TypeMIME = " & file.TypeMIME & "<BR>")

Response.Write("SubTypeMIME = " & file.SubTypeMIME & "<BR>")

response.write "File uploaded"

End If

Next

'------file uploading ends here

 

Back to Top
vidyaraghav View Drop Down
Newbie
Newbie


Joined: 22 September 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote vidyaraghav Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2003 at 2:35am
can anybody please help ...I have a lot of code dependent on this aspect
Back to Top
3BEPb View Drop Down
Groupie
Groupie


Joined: 07 August 2003
Location: United States
Status: Offline
Points: 81
Post Options Post Options   Thanks (0) Thanks(0)   Quote 3BEPb Quote  Post ReplyReply Direct Link To This Post Posted: 14 October 2003 at 12:57am

Dude, sorry for silence, I've been away for a while. I'm not sure abt the following part:

response.buffer=true

response.expires = 0

response.expiresabsolute = Now() - 1

Response.CacheControl = "no-cache"

I never really used this types of response, so I'm not sure what are they doing. Did you tried to disable them before uploading?

Back to Top
vidyaraghav View Drop Down
Newbie
Newbie


Joined: 22 September 2003
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote vidyaraghav Quote  Post ReplyReply Direct Link To This Post Posted: 15 October 2003 at 4:35am

Hi ...

Thanx for replying...

   I just tried to shortlist the whole thing and write a simple code for uploading....

     trialforaspupload.asp

  

<html>

<head>

<form name="uploading" method="post" enctype="multipart/form-data" action="

Pros.asp" >

Enter name of file :<input type=file name=filename>

<input type=submit name=submit value=submit>

</head>

</html>

 

Pros.asp:-

<%@ language="vbscript" %>

<%

response.write "into pros.asp"

Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")

mySmartUpload.Upload

for each file in mysmartupload.Files

if not file.isMissing then

response.write file.filename&" File is not missing"

sas=server.mappath("../../upload")&"\"&file.filename

response.write "sas="&sas

file.saveAs(sas)

End if

next

response.write "uploading over"

 

%>

as per what instructions you had given me i.e to remove all those response. ... variables

On the browser it accepts the file name and when the pros.asp gets executed... the result is

into pros.asp00000028.doc File is not missingsas=C:\upload\00000028.docuploading over

It Gives such a positive message....

          but the file has still not got saved into

    c:\upload

What do i do?......

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.