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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form upload problem

Status
Not open for further replies.

false420

Programmer
Mar 31, 2005
87
US
I have a form that users put in text, drop down menus, and a file to upload(if they want) the process works fine if the user inputs a file and submits the form, it then updates a database and send the mail with attachment. but when the user doesnt want to upload a file it gets hung up and says "The remote procedure call failed and did not execute" ive tried different if statements and stuff but cant figure out a way for this to work if user doesnt want to upload. here is the for and the peice of code on the other page where it gets hung up at
<table class="logonform">
<tr>
<td align = center><p class="tellenheader">Submit a Help Desk Ticket</p></td>
</tr>
<tr>
<td><hr /></td>
</tr>
<tr><td>
<%
'If the submitter is not yet in the submitter table pass ID=none in the query string.
If index1 > 0 Then
Response.Write "<form enctype='multipart/form-data' method='post' action='problem_tickets_receipt.asp?ID=Exists' id=form1 name=form1>"
Else
Response.Write "<form enctype='multipart/form-data' method='post' action='problem_tickets_receipt.asp?ID=none' id=form1 name=form1>"
End If
%>
<table>
<tr>
<td>Submitter Name</td>
<td width = 20>&nbsp;</td>
<td>Submitter Email</td>
<td width = 20>&nbsp;</td>
<td><tr>

<center><input type="file" name="f1"></center><br>
</td><input type="button" value="Update info" id="whatever" onclick="window.location.href=('helpdesk_info_update.asp'); ">
</tr>
<tr>
<%
'if submitter exists in database display thier info
If index1 > 0 Then
objRS_UserExists.MoveFirst
Response.Write "<td class='helpdeskdata'>" & objRS_UserExists("submitter_name") & "</td>"
Response.Write "<td>&nbsp</td>"
Response.Write "<td class='helpdeskdata'>" & objRS_UserExists("submitter_email") & "</td>"
'else display entry form fields
Else
Response.Write "<td><input type=text name=sub_name></td>"
Response.Write "<td>&nbsp</td>"
Response.Write "<td><input type=text name=sub_email></td>"
End If

objRS_UserExists.Close
Set objRS_UserExists = Nothing

%>

</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>User First Name</td>
<td>&nbsp;</td>
<td>User Last Name</td>
<td>&nbsp;</td>
<td>User Reference Number</td>
</tr>
<tr>
<td><input type=text name=fname></td>
<td>&nbsp;</td>
<td><input type=text name=lname></td>
<td>&nbsp;</td>
<td><input type=text name=wireless_num></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>Urgency</td>
<td>&nbsp;</td>
<td>Case Type</td>
</tr>
<tr>
<td><select name=urgency>
<option value="Low">Low
<option value="Medium">Medium
<option value="High">High
</select>
</td>
<td>&nbsp;</td>
<td><select name=case_type>
<option value="Request">Request
<option value="Problem">Problem
</select>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan = 5>Problem Subject(50 characters max)</td>
</tr>
<tr>
<td colspan = 5><input type=text name=problem_desc size = 50></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan = 5>Detailed Description</td>
</tr>
<tr>
<td colspan = 5><textarea rows="6" name="detailed_desc" cols="75"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td><input type=submit value="Submit Ticket"></td>
</tr>
</form>


here is other page where it gets hung up

<% Dim upl %>
<% Set upl = Server.CreateObject("SoftArtisans.FileUp") %>
---------tried to insert something like if upl.form("f1") <> "" then ------- but it wont work. it then just works the opposite way
<% upl.Path = "C:\WUtemp" %>
<% upl.Save %><BR>
<br><br>
<%
Dim Fileup
Fileup = upl.Form("f1").ServerName
%>
 
Sounds like a bug in the SoftArtisans.FileUp object

Which line causes the error? Is it:
Fileup = upl.Form("f1").ServerName

If not then can you do something like this:
If Fileup Is Nothing Then
'No file was uploaded
Else
'Do whatever with the file
End IF
 
yes it happens right under the declaration of the upl obj. i tried that kind of if statment but then it just totally disregards the fact that i would have a file to upload. work like nobody uploaded file either way. but without the if statement then when someone doesnt have a file to upload then it donts output
 
i was thinking of somewayof saying something like :
if the requesed form field is not empty then do this:
file upload stuff.
see the thing is when using fileup sa i have to put it into 1 form with enctype different ... which then makes request.form stuff into upl.form.
 
So you get an error just creating the object if there is no file in the current request header?
 
i found it. sa requires you to change pretty much everything when using it.
this right here worked
if upl.IsEmpty Then
its a special checking method. i just had to read the documentation. thanks for your help. you actually got me to thinking the rifght way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top