View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
I can't think of anything off the top of my head, but it would be helpful if you specified what you mean by "it seems to not upload some file types such as PDF or even FWX."  Are you getting an error message?  What's the message text?  Does it appear in the browser, or in the FoxWeb error log (or both)?  Do you still see the file on your hard-drive?  If yes, does it differ from the original?

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 09/09/2003 06:21:14 PM:
Well, that's great<s>. Any idea what may cause differences in trials? Thanks for your help.
 
Joe
Sent by FoxWeb Support on 09/08/2003 11:15:17 PM:
I tried your script on a couple of different test servers with no problems.  I did not test the part that writes the file to a table, but the files written to the upload directory are identical to the ones sent by the browser.  I tried all sorts of file types, including PDF, BMP, DOC and FWX.

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 09/04/2003 09:28:26 PM:
Sure thing, thanks for asking. Here is the whole thing. IT seems to not upload some file types such as PDF or even FWX. At times it even fails on DOC or GIF/JPG. What I would like to have is a routine that uploads any file type. Perhaps this does and I just have an error but I tried to be faithful in recreating the example upload.fwx in this code. Any thoughts or ideas would be appreciated.
 
*** BEGIN SOURCE ***
<%
LOCAL UPLOADNAME, UPLOADFILE, UPLOADTITLE, WHOLENAME, UPFILE
M.UPLOADNAME = ""
M.UPLOADFILE = ""
M.UPLOADTITLE = ""
M.WHOLENAME = ""
M.UPFILE = ""
%>
 
<%
IF Request.FormCount("btnchoice") > 0
   M.UPLOADFILE = ALLTRIM(Request.Form('UPLOADFILE'))
   M.UPLOADTITLE = ALLTRIM(Request.Form('UPLOADTITLE'))
  
   *** SEND IT ***
   FieldObject = Request.FormFieldObject("UPLOADFILE")
   IF FieldObject.ContentLength > 0
      FilePath = "..\upload\" + FieldObject.FileName
      STRTOFILE(FieldObject.Value(), FilePath)
   ENDIF
 
   *** Get path and file name for storage  ***
   lcLen = LEN(filepath)
   lcright = RIGHT(filepath,lclen-10)
   lcfilepath = "upload/"+lcright
 
   *** Open It  ***
   IF !USED('notesmenu')
      USE ../data/pbs!notesmenu SHARED IN 0
   ENDIF
   SELECT notesmenu
 
   *** Store it  ***
   APPEND BLANK
   lcID = idgenerate()    && Generate a unique ID
   REPLACE NID WITH lcID
   REPLACE NTITLE WITH M.UPLOADTITLE
   REPLACE NURL WITH lcfilepath
   USE       
   Response.Redirect("materials.fwx")
ENDIF
%>   
<html>
<head>
<title></title>
</head>
<BODY TOPMARGIN="0" LEFTMARGIN="0" BGCOLOR="#D1E5F3">
<TABLE>
   <TR>
      <TD>
         <form action="iUpload.fwx" method="post" enctype="multipart/form-data">
            <TABLE>
              <TR>
                 <TD ALIGN="Left" VALIGN="TOP"><B>Title</B></TD>
                 <TD>
                    <INPUT TYPE=text NAME="UPLOADTITLE" SIZE=80 MAXLENGTH=100 VALUE="<%=(M.UPLOADTITLE)%>">
                 </TD>
             </TR>
             <TR>
                <TD ALIGN="Left" VALIGN="TOP"><B>File to upload</B></TD>
                <TD>
                   <INPUT TYPE=file NAME="UPLOADFILE" SIZE=70 MAXLENGTH=100 VALUE="<%=(M.UPLOADFILE)%>">
                </TD>
             </TR>
                <TD ALIGN="Left" VALIGN="TOP"><B>Choose</B></TD>
                <TD>
                    <INPUT TYPE="SUBMIT" NAME=btnchoice VALUE="Upload">
                </TD>
              </TR>
           </TABLE>
        </FORM>
      </TD>
   </TR>
</TABLE>
</BODY>
</HTML>
 
*** END OF SOURCE ***
 
Sent by FoxWeb Support on 09/04/2003 04:59:03 PM:
The upload.fwx script and the techniques employed by it have been utilized in many applications with no known issues.  Please provide additional details on the nature of the problem.

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 09/03/2003 08:45:34 AM:
Hello. I was using the upload.fwx example to upload files but realized that some files, such as .zip, was not uploading. IS there a way to upload any type of file?
 
JOe