Advertisement
Advertisement
| 05.05.2008 at 11:42AM PDT, ID: 23377285 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: |
<CFIF isDefined("Form.isLogo")>
<cfif isdefined("form.upload_now")>
<!--- Get photo count to see if we are already at our limit --->
<cfquery name="getphotos" datasource="security">
SELECT Count(logoID) AS PhotoCount
FROM logo
WHERE memberID = #memberID#
</cfquery>
<cfset destination="c:\coldfusion8\wwwroot\myMobi\photos\m"&#memberID#&"\logo\" >
<cfset destinationtemp="c:\coldfusion8\wwwroot\myMobi\photos\temp\">
<cfif Not DirectoryExists(destination) >
<cfdirectory action="create" directory="#destination#" >
</cfif>
<!--- Check limit --->
<cfif getphotos.PhotoCount GTE 1>
<span class="style2">Only 1 photo can be uploaded to the system. Delete your logo to uploaded a different one.
<cfelse>
<!--- Upload file --->
<cffile action="upload" filefield="ul_path" destination="#destinationtemp#" accept="image/jpg, image/jpeg, image/pjpeg, pjpg" nameConflict= "MakeUnique">
<cfimage action="resize" source="#destinationtemp##serverfile#" width="150" Height="150" destination="#destinationtemp##serverfile#" overwrite="true" />
<cffile action="copy" source="#destinationtemp##serverfile#" destination="#destination#logo.jpg">
<cfset clientFile = #cffile.clientFile#>
<cfoutput>File uploaded succesfully #destination##serverFile#</cfoutput>
<!--- Check filetype --->
<cfif cffile.ClientFileExt NEQ "jpg" AND cffile.ClientFileExt NEQ "jpeg">
File is wrong type. You can only upload JPG file types.
<cffile action="delete" file="#destination#">
</cfif>
<!--- Make sure file upload was success, then create database record --->
<cfif FileExists("#destination##cffile.serverFile#")>
<cftry>
<cfquery name="createPhotoRecord" datasource="security">
INSERT INTO logo(memberid,location,filename)
VALUES(<cfqueryparam cfsqltype="CF_SQL_BIGINT" value="#memberid#">,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#destination#">,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="#clientFile#">)
</cfquery>
<cfcatch>
<br>
-->File replaced.<br>
</cfcatch>
</cftry>
<cfelse>
</cfif>
</span>
</cfif>
</cfif>
|