CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> General/Other

 File Upload and PHP for Store Example

Print topic Send  topic

Author Message
wizy

Posts: 40
Posted: 05/15/2006, 5:34 PM

Anyone have a working example of the File UPload component using PHP?

I found some threads, but they aren't very clear on instructions.

Im using the Store example and modifuing hte Product REcord page to change the "image url" path to an upload component. So what i needs is that the form automatically fill in the url instead of us manually inputting the path to the uploaded image.

And how do we get rid of the automatic addition of the "timedate" being appended to the beginning of a filename? IF i upload avatar.jpg I want the file name to remain avatar.jpg
View profile  Send private message
wizy

Posts: 40
Posted: 05/16/2006, 12:43 PM

anyone?
View profile  Send private message
WKempees
Posted: 05/17/2006, 1:56 AM


In ASP there is a FileUpload Component, several.
In PhP you just start with the documentation, the help file and these fora.

"wizy" <wizy@forum.codecharge> schreef in bericht
news:244691e304cb2b@news.codecharge.com...
> Anyone have a working example of the File UPload component using PHP?
>
> I found some threads, but they aren't very clear on instructions.
>
> Im using the Store example and modifuing hte Product REcord page to change
> the
> "image url" path to an upload component. So what i needs is that the form
> automatically fill in the url instead of us manually inputting the path to
> the
> uploaded image.
>
> And how do we get rid of the automatic addition of the "timedate" being
> appended to the beginning of a filename? IF i upload avatar.jpg I want the
> file
> name to remain avatar.jpg
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

wizy

Posts: 40
Posted: 05/17/2006, 12:44 PM

huh? I dont see any documentation? Could someone please provide a working tutorial? And I dont know ASP so I cnat use it.
View profile  Send private message
wizy

Posts: 40
Posted: 05/17/2006, 12:46 PM

the only things I've found were not clear in explanation. Please provide a link to a tutorial; step by step. you know, something that shows pictures and exactly what coding needs to have done so that a file upload for the store example autmoatically fills in the Img URl field with the xact location to the image that has been uploaded and to have it show up when its done? And how to stop it from appending a date/time to the front of a file name.
View profile  Send private message
peterr


Posts: 5971
Posted: 05/17/2006, 1:04 PM

I suspect that no one will find time to write tutorials for you...

Uploading files is very easy. Simply add FileUpload component to your form. There is also an example of uploading multiple files in CCS. And looks like you already implemented file upload anyway, because you wrote that "timedate" is being appended to filenames. (and this is needed functionality, so don't change it)
The file name is automatically saved in the database, so you can easily create URLs from any Web page.

You can find a lot of other information here on the forums, or describe the problem that you have so that somebody can help you with specific question.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
wizy

Posts: 40
Posted: 05/22/2006, 12:28 PM

1) I DONT want the time date added to it. How do I prevent it from adding it?
2) I used the upload, but I dont see the URL being written/saved to any database field at all.
View profile  Send private message
wizy

Posts: 40
Posted: 05/22/2006, 12:30 PM

Let me clarify point two: I dont watn the name of the file saved to the Datbase field. I want the URL to that file on the server to be saved to the database. I dont see how the FileUpload component does this. That's why I asked for a someone to explain it step by step. There is nothing on these forums that provide a clear explanation on how to use the file upload component.
View profile  Send private message
wizy

Posts: 40
Posted: 05/22/2006, 12:37 PM

And this is for PHP with templates
View profile  Send private message
peterr


Posts: 5971
Posted: 05/22/2006, 12:43 PM

There is no such need, and there is no way to know the URL. And one file can be displayed on different Web pages using many different URLs, like:
../../files/filename.gif
../files/filename.gif
/files/filename.gif
/filename.gif
http://www.domain1.com/filename.gif
http://www.domain2.com/filename.gif (different domain for the same Website)
These are all different URLs for the same exact file.

Thus you can simply construct different URLs on different Web pages where you display your files/images. Simply type on your Web page "../files/" (or other folder name with your files) before the image that you are displaying.

And BTW, this was already discussed and described on these forums.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
wizy

Posts: 40
Posted: 05/22/2006, 12:46 PM

IN which threads? I've searched but I found nothing that describes what you are saying.

1) how do you prevent the time/date appending? I dont want it to happen.
2) how does it write to the Database field? I uploaded it, but the field was filled in with "NULL".
View profile  Send private message
peterr


Posts: 5971
Posted: 05/22/2006, 1:10 PM

Unfortunately I don't have time to read through past threads right now, but here are at least couple to look at:
http://forums.codecharge.com/posts.php?post_id=74606
http://forums.codecharge.com/posts.php?post_id=48035

Re: 1
This is not supported due to application security and other concerns. However, if you really don't want this then you can try removing date("YmdHis"), or ask support.

Re: 2
This is automatic and I have never seen this not working, so I cannot answer your question. You may want to check with the support as well.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 05/22/2006, 1:21 PM

Sorry, I meant "you can try removing date("YmdHis") from Classes.php".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
wizy

Posts: 40
Posted: 05/23/2006, 2:16 PM

Quote peterr:


Re: 1
This is not supported due to application security and other concerns. However, if you really don't want this then you can try removing date("YmdHis"), or ask support.

what would be the security issue to uploading a file with its original name?
If many other applications (ie PhotoGalleries, download galleries, etc) can work without having a date/time appended to the file name, why can't CCS? I dont see any "security" risk into keeping the original file name.
View profile  Send private message
nightbeat

Posts: 6
Posted: 05/24/2006, 8:09 PM

i am facing the exact same problem, wizy i think instead of modifying the file upload control, we can try to do something to the image control, so that it can somehow get the image using SOMEPATH and the name in the database!
View profile  Send private message
jleertou2

Posts: 1
Posted: 06/07/2006, 1:49 PM

Quote peterr:
Unfortunately I don't have time to read through past threads right now, but here are at least couple to look at:
http://forums.codecharge.com/posts.php?post_id=74606
http://forums.codecharge.com/posts.php?post_id=48035

Re: 1
This is not supported due to application security and other concerns. However, if you really don't want this then you can try removing date("YmdHis"), or ask support.

Re: 2
This is automatic and I have never seen this not working, so I cannot answer your question. You may want to check with the support as well.

Hello Peter,
I'm having same problem, file is uploaded, but nothing is added to the database, using PHP 4 and mysql 4.1
View profile  Send private message
peterr


Posts: 5971
Posted: 06/07/2006, 2:06 PM

jleertou2,
Not sure what do you need from me since you just quoted my answer to your exact question.
"Re: 2
This is automatic and I have never seen this not working, so I cannot answer your question. You may want to check with the support as well."
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
WKempees
Posted: 06/07/2006, 2:17 PM

nightbeat,
Quote :
i am facing the exact same problem, wizy i think instead of modifying the
file
upload control, we can try to do something to the image control, so that it
can
somehow get the image using SOMEPATH and the name in the database!
There is an "Action - Get Original Filename" that you might use to tackle
your approach.
Also this thread was maintained double, you might find some interesting and
boring reading here :
http://forums.codecharge.com/posts.php?post_id=75071
Don't tell anyone I sent you there.

Walter


Add new topic Subscribe to topic   


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

PHP Reports

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

Home   |    Search   |    Members   |    Register   |    Login


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