MMsabry
asked on
slow file upload and an error
Hi, I have made a page where users can upload some word files,
the first problem is that the page is quit slow! is there reason for that.
The second problem is that if the user has the word file open (they can only upload word files) the server gives an error! how can one deal with that, other than to warn the users not to have their files open?
thanks
the first problem is that the page is quit slow! is there reason for that.
The second problem is that if the user has the word file open (they can only upload word files) the server gives an error! how can one deal with that, other than to warn the users not to have their files open?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i guess the way ur doing is not right ...
I suppose u wld wanna do FILE.SERVERFILE to insert the file name of the uploade file in the DB [after using CFFILE]
refer https://www.experts-exchange.com/questions/20663901/Users-uploading-pictures.html & lemme know ...
I suppose u wld wanna do FILE.SERVERFILE to insert the file name of the uploade file in the DB [after using CFFILE]
refer https://www.experts-exchange.com/questions/20663901/Users-uploading-pictures.html & lemme know ...
ASKER
Jester_48,
The line that is give is number 2, and line 2 contains the code to resterict access to the page.!!
yes i also stopped using cfqueryparam, bec. all the values in this case are id numbers returned from other queries, so they info already on my db.
anandkp,
I do not understand your comment, since I do what you indicated, these queries are after the file has been uploaded.
also no one has gotten around to answer the question about file upload error when the word file is open, and sometimes it is a word file that is to be uploaded but it still gives the error that this is not a word file!
thanks
The line that is give is number 2, and line 2 contains the code to resterict access to the page.!!
yes i also stopped using cfqueryparam, bec. all the values in this case are id numbers returned from other queries, so they info already on my db.
anandkp,
I do not understand your comment, since I do what you indicated, these queries are after the file has been uploaded.
also no one has gotten around to answer the question about file upload error when the word file is open, and sometimes it is a word file that is to be uploaded but it still gives the error that this is not a word file!
thanks
hih, what is the code of uploading...
are you having some problem due to mime type or something ...?
are you having some problem due to mime type or something ...?
ASKER
this the code for uploading
<cffile accept="application/msword " action="upload" destination="C:\CFusionMX\ wwwroot\si te\Abstrac ts\" filefield="form.userfile" nameconflict="overwrite">
forget about the query problem, i solved it there was a typo in the values in the db, so in this sense Pinal was right, it was getting a null value.
now the problem i get with the upload is the following:
1- if the file to be uploaded is open in the application (in this case MS word) it throughs an error
2-once in a while, with certain files (i made sure that they are ms word) it insists that they are not.
<cffile accept="application/msword
forget about the query problem, i solved it there was a typo in the values in the db, so in this sense Pinal was right, it was getting a null value.
now the problem i get with the upload is the following:
1- if the file to be uploaded is open in the application (in this case MS word) it throughs an error
2-once in a while, with certain files (i made sure that they are ms word) it insists that they are not.
I think Q 1) is going to be like that. That is the system behaviour and property.
Try this mime types also for Q 2)
application/x-msdownload
Also some time Windows opens the file as that file could be opened with words but actually that can be any files adn we need specific mime types for them...
here is the list of some of the word related mime types try them....
http://www.utoronto.ca/ian/books/html4ed/appb/mimetype.html
Regards,
---Pinal
ASKER
Pinaldave,
application/x-msdownload did not work at all, even for the files that used to work before,
the link you provided is very nice but not in this case, since they also indicate that for ms word, i would only use "application/msword"!
so any solutions!!
application/x-msdownload did not work at all, even for the files that used to work before,
the link you provided is very nice but not in this case, since they also indicate that for ms word, i would only use "application/msword"!
so any solutions!!
ASKER
the error is : invalide synthax near ')"
here are the queries
<cftransaction>
<cftry>
<cflock type="readonly" scope="session" timeout="50" throwontimeout="no">
<cfset Abstr = Duplicate(Session.PartAct.
<cfset Pinfo = Duplicate(Session.PartAct.
</cflock>
<cfquery name="Abst" datasource="#request.MyDSN
INSERT INTO Abst (Title, Location)
VALUES (<cfqueryparam cfsqltype="cf_sql_varchar"
<cfqueryparam cfsqltype="cf_sql_varchar"
value="files\#form.filenam
</cfquery>
<cfquery name="AbstID" datasource="#request.MyDSN
SELECT Title, Abst_ID as ID FROM Abst
WHERE Title=<cfqueryparam cfsqltype="cf_sql_varchar"
</cfquery>
<cfquery name="TypeID" datasource="#request.MyDSN
SELECT Type, Type_ID AS TID FROM Type
WHERE Type=<cfqueryparam cfsqltype="cf_sql_varchar"
</cfquery>
<cfquery name="TopicsID" datasource="#request.MyDSN
SELECT Topic, Topic_ID As TOID FROM Topics
WHERE Topic=<cfqueryparam cfsqltype="cf_sql_varchar"
</cfquery>
<cfquery name="Insert1" datasource="#request.MyDSN
Insert into Cont (P_ID, Abst_ID, Type_ID, Topic_ID)
VALUES (#Pinfo[5]#,#AbstID.ID#,#T
</cfquery>
<cfquery name="Insert2" datasource="#request.MyDSN
Insert into Abst_Status (Abst_ID)
VALUES (#AbstID.ID#)
</cfquery>
<cfset SendEmail = 1>
<cfoutput>
some html
</cfoutput>
<cfcatch>
<cfoutput> some html</cfoutput>
</cfcatch>
</cftry>
</cftransaction>