Jump to content

Recommended Posts

We are using tools4php to create our quote forms with captcha. All is working well, however we are not able have eps files attached to quote form, even though when trying to attach a file and submit, it says: Please enter a valid file. jpg gif doc pub and eps

 

Our current code relating to file attachments is as follows:

if( $file_Mime_Type != "" AND $file_Mime_Type != "application/msword" AND $file_Mime_Type != "application/postscript" AND $file_Mime_Type != "application/vnd.ms-publisher" AND $file_Mime_Type != "image/gif" AND $file_Mime_Type != "image/pjpeg" AND $file_Mime_Type != "image/jpeg" )

 

I tried modifying with the following which didnt work:

if( $file_Mime_Type != "" AND $file_Mime_Type != "application/msword" AND $file_Mime_Type != "application/postscript" AND $file_Mime_Type != "application/vnd.ms-publisher" AND $file_Mime_Type != "image/gif" AND $file_Mime_Type != "image/pjpeg" AND $file_Mime_Type != "image/jpeg" AND $file_Mime_Type != "image/eps"  )

 

We are also unable to upload pdf files with quote form.

 

I dont see any other file or area to edit that relates to file types that can be uploaded.  ???

Any ideas on what may be the problem? Thanks in advance.

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/128198-tools4php-form-help/
Share on other sites

http://filext.com/file-extension/EPS

 

They can have several MIME types, so it'll be hard to add them all in accurately.  Also, MIME types from the browser can't be trusted all too much.

 

And btw, that code looks like crap.  You should really learn PHP and write up a simple form for yourself.

Link to comment
https://forums.phpfreaks.com/topic/128198-tools4php-form-help/#findComment-663943
Share on other sites

DW, thanks for your reply. Unfortunately, I am only filling in and trying to make sense of this coding. We had a programmer create our forms using tools4php software and the owner of the site couldnt help us as to why the eps or pdf files were not able to attach to forms. our old webmaster is no longer available so we are trying to pick up the pieces and try to make the most of it.

Link to comment
https://forums.phpfreaks.com/topic/128198-tools4php-form-help/#findComment-663996
Share on other sites

I think this everything your asking for. Thanks for the link. Ill check it out soon as I get a chance. Problem with me learning php is we had severe attacks, header injections about a year ago with an old programmer. Then we hired someone make forms more secure which is what you see here. It seems to work so far, but we cant get eps or pdf files to upload.

 

//delete file 
unlink($file_Temp);
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Max file size is 500kb.  Please enter a valid file.</font></p>");
}
if( $file_Mime_Type != "" AND $file_Mime_Type != "application/msword" AND $file_Mime_Type != "application/postscript" AND $file_Mime_Type != "application/vnd.ms-publisher" AND $file_Mime_Type != "image/gif" AND $file_Mime_Type != "image/pjpeg" AND $file_Mime_Type != "image/jpeg" )
{
unlink($file_Temp);
die("<p align='center'><font face='Arial' size='3' color='#FF0000'>Please enter a valid file. jpg gif doc pub and eps</font></p>");
}

//Find the extension to the uploaded file
function findexts ($file_Name)
{
$file_Name = strtolower($file_Name) ;
$exts = split("[/\\.]", $file_Name) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}

//This applies the function to our file
$ext = findexts ($_FILES['file']['name']) ;

//This line assigns a random number to a variable
    $ran = rand () ;

//This takes the random name
    $ran2 = $ran.".";

Link to comment
https://forums.phpfreaks.com/topic/128198-tools4php-form-help/#findComment-664014
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.