Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
infa #1
Uploading image
I'm got a cool uploading images tutorial from Asfusion.com. I got it working
but this is my issue. I created a db table called "photos", in the photos
table I made two columns named "id" and "images". I'm allowing users to login
and upload images to a folder on my server. I now want to save the name of the
image that was uploaded, to my db column named "images" aswell as save the user
id to my "id" column. I'm using SESSION.Auth.id .
I'm using a tabbed cfform to do this, what I'm trying to make happen is on one
tab is the upload field and upload button, on the second tab I want to bind the
images that was upload by a specifc user (called by the id) to a cfgrid and
display all the images uploaded by that user. So I want to associate all the
images of a specific user to there user id.
How do I send the users id through the query string to get saved to my db
table called photos?
If my code is incorrect, can someone lead me in the right direction? Or is
there an easier way to get what I nreed to get done?
Thanks
Rob
This is the upload code:
<cf_flashUpload label="Picture:" name="myfile2" fileTypes="*.jpg;*.png;*.gif"
fileDescription="Image files" actionFile="upload.cfm" maxSize="500">
<cf_flashUploadInput buttonStyle="corner-radius: 10;"
inputStyle="fontWeight:bold" inputWidth="190" uploadButton="true"
uploadButtonLabel="Upload" chooseButtonLabel="Choose file" progressBar="true"
progressInfo="true" required="yes" message="Please enter a valid file to
upload!" />
</cf_flashUpload>
This is the processing script:
<cfif structkeyexists(form,"Filedata")>
<cffile action="UPLOAD" filefield="FileData"
destination="#expandpath("\uploads")#" nameconflict="MAKEUNIQUE">
</cfif>
<CFQUERY DATASOURCE="#DataSource#">
INSERT into photos(images,id)
VALUES('#Trim(FORM.myfile2)#',
('#Trim(URL.SESSION.Auth.id)#')
</CFQUERY>
infa Guest
-
Don't want an /image folder when uploading images
I want to be able to upload image files from my local computer using Contribute CS3 without having the program create an IMAGES folder. I don't... -
uploading imageready image map
hello, i'm pretty new to photoshop and have just made my first image map with rollovers using photoshop and imageready. when i preview it in the... -
Uploading image and text into a database
Hi All, I would like to know if there is a way to upload an image and text into an Access database using asp. I have a web site hosted on a web... -
ObjectDisposedException after uploading image via Dime
After I upload an image to my webservice using a dime attachment I receive ObjectDisposedException on any subsequent calls to any method on the web... -
Uploading an Image from a web page
I am using the control type = file to perform a file upload. When I click on the browse button to go select the image I want to upload it places... -
Rick #2
Re: Uploading image
Add a cfinput to your for name it whatever your db field is and use
SESSION.Auth.id vaerable as the value. Then pass this over to the cfc via
the remoting and insert it into your db.
"infa" <webforumsuser@macromedia.com> wrote in message
news:ee5e7v$mgk$1@forums.macromedia.com...> I'm got a cool uploading images tutorial from Asfusion.com. I got it
> working
> but this is my issue. I created a db table called "photos", in the photos
> table I made two columns named "id" and "images". I'm allowing users to
> login
> and upload images to a folder on my server. I now want to save the name
> of the
> image that was uploaded, to my db column named "images" aswell as save the
> user
> id to my "id" column. I'm using SESSION.Auth.id .
>
> I'm using a tabbed cfform to do this, what I'm trying to make happen is on
> one
> tab is the upload field and upload button, on the second tab I want to
> bind the
> images that was upload by a specifc user (called by the id) to a cfgrid
> and
> display all the images uploaded by that user. So I want to associate all
> the
> images of a specific user to there user id.
>
> How do I send the users id through the query string to get saved to my db
> table called photos?
>
> If my code is incorrect, can someone lead me in the right direction? Or is
> there an easier way to get what I nreed to get done?
>
> Thanks
> Rob
>
>
> This is the upload code:
>
> <cf_flashUpload label="Picture:" name="myfile2"
> fileTypes="*.jpg;*.png;*.gif"
> fileDescription="Image files" actionFile="upload.cfm" maxSize="500">
>
>
> <cf_flashUploadInput buttonStyle="corner-radius: 10;"
> inputStyle="fontWeight:bold" inputWidth="190" uploadButton="true"
> uploadButtonLabel="Upload" chooseButtonLabel="Choose file"
> progressBar="true"
> progressInfo="true" required="yes" message="Please enter a valid file to
> upload!" />
> </cf_flashUpload>
>
> This is the processing script:
>
> <cfif structkeyexists(form,"Filedata")>
> <cffile action="UPLOAD" filefield="FileData"
> destination="#expandpath("\uploads")#" nameconflict="MAKEUNIQUE">
> </cfif>
>
>
> <CFQUERY DATASOURCE="#DataSource#">
> INSERT into photos(images,id)
> VALUES('#Trim(FORM.myfile2)#',
> ('#Trim(URL.SESSION.Auth.id)#')
> </CFQUERY>
>
>
Rick Guest
-
infa #3
Re: Uploading image
Ok, I'm new to cf so if I understand you, this is what I should do:
<cfinput
type="Text"
name="myimages" (This is the name of my image table)
value="SESSION.Auth.id"
size="20"
maxlength="100">
Now from here, do I ad this field above my upload field?
And does the user enter their id into this field before they uploading?
Could you perhaps write an example code of passing the value to the cfc.
Again I'm new to cf, I understand what they are and how they work thanks ot Ben
Forta's book, but I have not yet try to make one. this is the part of you
message that has me puzzled:
"Then pass this over to the cfc via
the remoting and insert it into your db."
Thanks a lot Rick for your help.
Rob.
infa Guest



Reply With Quote

