Help with Multipart and uploading images

Is Coranto not working properly for you? Here's where to ask for support help; for best results, follow these steps:
  • - Check your core/addon documentation for possible solutions
  • - Search these forums for similar problems that have already been solved
  • - If you're still stumped, check out THIS TOPIC, and post your question in this forum!!

Moderators: Spunkmeyer, Dale Ray, SrNupsen, Bluetooth, Jackanape

Help with Multipart and uploading images

Postby Tabbu » Thu Nov 29, 2007 11:36 am

I'm trying to add a small image to my news item. I just don't understand what should I do.

I added a new field (CustomField_Image) and made it "file upload".

Then I used the file upload in build news to import my jpg. What now?! I tried to read some tutorials but they are difficult to understand.

"FilePath: CustomField_X> The http path to the specific file in the File Upload field and current newsitem."

What does this mean? Do I have to upload the jpg to html server? What I have to write into the news field?

Could you give a practical example how to do this.

Thank you so much,

Br,
Tapani
Tabbu
 
Posts: 5
Joined: Fri Jul 06, 2007 1:53 pm

Postby Jackanape » Fri Nov 30, 2007 2:21 pm

I'm not sure exactly where you're running into trouble, so I'll try to cover a few things at once here:

Firstly, your upload field--is it working? To set the upload path, check out the field settings, specifically, the Upload Path, and Upload directory. You will also want to make sure you have write permissions to those directories.

As for the style, here's an example that I'm currently using:
Code: Select all
<div class="picsleft">
<h5><Field: Subject></h5>
<center>
<Field: CustomField_photos>
<img src="<FilePath: CustomField_photos>">
<Field: CustomField_caption>
<p>CustomField_caption</p>
<h6><Field: Date></h6>
</center>
</div>


I hope this helps some.
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby Tabbu » Thu Dec 13, 2007 4:18 pm

Jackanape wrote:I'm not sure exactly where you're running into trouble, so I'll try to cover a few things at once here:

Firstly, your upload field--is it working? To set the upload path, check out the field settings, specifically, the Upload Path, and Upload directory. You will also want to make sure you have write permissions to those directories.

As for the style, here's an example that I'm currently using:
Code: Select all
<div class="picsleft">
<h5><Field: Subject></h5>
<center>
<Field: CustomField_photos>
<img src="<FilePath: CustomField_photos>">
<Field: CustomField_caption>
<p>CustomField_caption</p>
<h6><Field: Date></h6>
</center>
</div>


I hope this helps some.


Ok thanks. No how can I hide the file name? I don't want any "image.jpg" with my image file.

EDIT: I fixed that, but I've noticed another problem. On Explorer all the news files that DON'T have image uploaded with them show a "missing picture" X. How can I get around of this?

EDIT2: Here's the style code that I'm using:

<p><Field: Date> - <strong><Field: Subject></strong><br />
<img src="<FilePath: CustomField_Image>"><br />
<Field: Text></p>
Last edited by Tabbu on Thu Dec 13, 2007 4:43 pm, edited 1 time in total.
Tabbu
 
Posts: 5
Joined: Fri Jul 06, 2007 1:53 pm

Postby Jackanape » Thu Dec 13, 2007 4:32 pm

The name of the file shouldn't appear at all, unless it's included in your style. If this is just an uploaded file, I suppose the Subject could be the file name? Could you be more specific about where it's appearing, what style you're using, are you uploading via a multipart profile, or just uploading via the upload form?
A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
-Robert A. Heinlein
User avatar
Jackanape
 
Posts: 632
Joined: Tue Jan 09, 2007 12:15 am
Location: Capitol of the Great State of New York

Postby SrNupsen » Thu Dec 13, 2007 6:22 pm

Tabbu wrote:Here's the style code that I'm using:

<p><Field: Date> - <strong><Field: Subject></strong><br />
<img src="<FilePath: CustomField_Image>"><br />
<Field: Text></p>



You get around this by first checking if the field is set. Change your style to this:

Code: Select all
<p><Field: Date> - <strong><Field: Subject></strong><br />
[color=red]<If: Field: CustomField_Image>[/color]
<img src="<FilePath: CustomField_Image>">
[color=red]</If>[/color]
<br />
<Field: Text></p>
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby SrNupsen » Thu Dec 13, 2007 6:25 pm

Jackanape wrote:
As for the style, here's an example that I'm currently using:
Code: Select all
<div class="picsleft">
<h5><Field: Subject></h5>
<center>
[color=red]<Field: CustomField_photos> [/color]
<img src="<FilePath: CustomField_photos>">
<Field: CustomField_caption>
<p>CustomField_caption</p>
<h6><Field: Date></h6>
</center>
</div>


I hope this helps some.


The filename appearing was due to this line in the example Jack provided, I guess. But since you fixed it anyway... :)
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 3 guests

cron