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

MIMe Problems

Status
Not open for further replies.

izachar

Technical User
Oct 7, 2000
84
CA
I have a form where the user needs to upload a pdf document. I am using Accept="application/pdf" but it is giving me an error. I have acrobat installed on my machine so I assume it has the mime type registered. Can anyone help?
 
Do you have [COLOR=CC3300]METHOD="post"[/color] and [COLOR=CC3300]ENCTYPE="multipart/form-data"[/color]. You must have both in your form when uploading files.

[COLOR=CC3300]<FORM NAME=&quot;myName&quot; ACTION=&quot;mypage.cfm&quot;
METHOD=&quot;post&quot; ENCTYPE=&quot;multipart/form-data&quot;>[/color] - tleish
 
Yes this is the 4th thing that is uploaded the other 3 I am using accept=image/gif and it is working fine just on this one where I specify application it is not working
 
try using this; it worked on my computer:

<cfif IsDefined(&quot;action&quot;)>
<cfset curDirectory = GetDirectoryFromPath(GetTemplatePath())>
<cffile action=&quot;upload&quot;
filefield=&quot;submittedFile&quot;
destination=&quot;#curDirectory#&quot;
nameconflict=&quot;makeunique&quot;
accept=&quot;application/pdf&quot;>

<cfoutput>#File.ContentType#/#File.ContentSubType#</cfoutput>
</cfif>
<form action=&quot;test.cfm?action=true&quot; name=&quot;submitFile&quot; enctype=&quot;multipart/form-data&quot; method=&quot;post&quot;>

<input type=&quot;file&quot; name=&quot;submittedFile&quot; size=&quot;47&quot;>

<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit Resource&quot;>
</form> Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top