CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 php file upload form - together with record form

Print topic Send  topic

Author Message
Tomasz
Posted: 04/24/2002, 6:57 AM

I use file upload on my pages baed on example found at T&T - it works, but this solution is a little bit confusing: you must create record first, then add picture to it.
Proper solution would be input type=file field inside record form.
Does anybody tried to achieve this in CC without manual edit of php file?
(PHP+tpl)
Alex Alexapolsky
Posted: 04/24/2002, 7:08 AM

As you see , input = file is located in header&footer form ,
you can paste upload form html code into any header&footer section in
CC , be that record or menu.
Tomasz
Posted: 04/24/2002, 7:18 AM

Alex,
As I said I strictly do it that way;-)

but: It creates separate form.

I've asked if it possible to include file field INTO present form
Steve F.
Posted: 04/24/2002, 7:26 AM

Hi,

I modified the ASP version upload to do this and am currently changing the PHP as well. My solution in ASP will differ a bit due to the "HEADER()" functionality in PHP but will be quite similar. Here's what I did...

I had a list of projects in one form on the page, and a list of attachments or "items" in another form. The "insert" link pointed to the page containing the upload form passing along the project_id as a parameter.

The page loads, but before showing any content Inserts a record into the attaachments table (I believe this a pictures table in the example).

When this is complete, I ran a simple query to select the last record inserted by the user (SELECT MAX(item_id) from attachments where added_by =......)

At this point, there is a record in the database for this upload, the project_id it is for, and the person who added it. Now, all we need to do is upload the file.

I put in a simple redirect(ASP version) to the same page, passing the item_id as a parameter, and was able to upload the file associated with the project. Although it appears complex, it really isn't, and everything appears to happen in one quick step to the user. The only difference with PHP is the fact that I may have to tweak the redirect stuff. Once I am done, I'll try post an example in the tips section, but I think I've described the process enough for you get the general idea of what I did.

Steve

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.